moranI.boot | R Documentation |
Generate bootstrap replicates of Moran's I autocorrelation statistic, by means of function boot form boot library. Notice that these functions should not be used separately but as argument statistic when calling function boot.
moranI.boot is used when performing a non-parametric bootstrap.
moranI.pboot is used when performing a parametric bootstrap.
moranI.boot(data, i, ...)
moranI.pboot(...)
data |
A dataframe containing the data, as specified in the DClustermanpage. |
i |
Permutation generated by the bootstrap procedure |
... |
Aditional arguments passed when performing a bootstrap. |
Both functions return the value of the statistic.
Moran, P. A. P. (1948). The interpretation os statistical maps. Journal of the Royal Statistical Society, Series B 10, 243-251.
DCluster, boot, moranI, moranI.stat
library(spdep)
data(nc.sids)
col.W <- nb2listw(ncCR85.nb, zero.policy=TRUE)
sids<-data.frame(Observed=nc.sids$SID74)
sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74))
niter<-100
#Permutation model
moran.boot<-boot(sids, statistic=moranI.boot, R=niter, listw=col.W,
n=length(ncCR85.nb), S0=Szero(col.W) )
plot(moran.boot)#Display results
#Multinomial model
moran.mboot<-boot(sids, statistic=moranI.pboot, sim="parametric",
ran.gen=multinom.sim, R=niter, listw=col.W,n=length(ncCR85.nb),
S0=Szero(col.W) )
plot(moran.mboot)#Display results
#Poisson model
moran.pboot<-boot(sids, statistic=moranI.pboot, sim="parametric",
ran.gen=poisson.sim, R=niter, listw=col.W,n=length(ncCR85.nb),
S0=Szero(col.W) )
plot(moran.pboot)#Display results
#Poisson-Gamma model
moran.pgboot<-boot(sids, statistic=moranI.pboot, sim="parametric",
ran.gen=negbin.sim, R=niter, listw=col.W,n=length(ncCR85.nb),
S0=Szero(col.W) )
plot(moran.pgboot)#Display results
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.