Displaying 1 result from an estimated 1 matches for "dist80sw".
Did you mean:
dist60sw
2009 Jul 15
1
Simulation code error
...xx)
+ V <- paste(V, collapse="+")
+ V <- paste("SBA~", V)
+ rd <- round(nrow(data)*(2/3))
+ d <- sample(seq(1:nrow(data)),rd)
+ dat1 <- data[d,]
+ dat2 <- data[-d,]
+ crd <- cbind(dat1$Longitude,dat1$Latitude)
+ dist80 <- dnearneigh(crd,0,100,longlat=F)
+ dist80sw <- nb2listw(dist80, style="B")
+ fm <- errorsarlm(as.formula(V), data=dat1, listw=dist60sw)
+ pred <- predict(fm,dat2)
+ C[i,1] <- cor(dat2$SBA,pred)
+ out <- cbind(C)
+ }
+ colMeans(out)
+ }
>
> sim.sp(df2007.5k.s2,CM,1,1000)
Error in nb2listw(dist80, style = "B...