Hello, 

I am interested in using Morans I for different time intervals to detect 
disease clusters. 

Ultimately I would like to use CUSUM - or similar monitoring statistic to 
monitor the results of Morans I - similar to the work by 
Rogerson (2005) Spatial Surveillance and Cummulative Sum Methods in Spatial and 
Syndromic Surveillance for Public Health. 

Thus far - thanks to the list I have Morans I running in a loop for each day 
(however I found that on some days no data is recorded, this caused an error to 
get around this error I included an elseif statement to skip the calculation 
for days where no disease notifications are recorded.) 

I am just wondering if anyone has code/advice for the best way to apprach the 
next stage of monitoring Morans I over different time intervals for the 
detection of abnormal clusters. My code thus far is below - I would also like 
to assemble the results in a neat table if anyone has tips for this I would alo 
appreciate it as I am rather new to R! 

Thanks
Serryn

T1<-read.dbf("ob.dbf")
N <- colnames(T1)

T2nb <- read.gal("PC.gal",override=TRUE)
col.W <- nb2listw(T2nb, style="W")

for(i in seq(N)) {   
      Vec1 <- spNamedVec(N[i+7], T1)
      Svec1<-sum(Vec1)
       ifelse ( Svec1> 0, res[i]<-moran.test(spNamedVec(N[i+7], T1), col.W, 
zero.policy=TRUE), res[i]<-"NULL") 

                        }

print(res)






        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to