Description Usage Arguments Value References See Also Examples
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.
1 2 | 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 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
|
sh: 1: cannot create /dev/null: Permission denied
Loading required package: boot
Loading required package: spdep
Loading required package: sp
Loading required package: spData
To access larger datasets in this package, install the spDataLarge
package with: `install.packages('spDataLarge',
repos='https://nowosad.github.io/drat/', type='source')`
Loading required package: sf
sh: 1: cannot create /dev/null: Permission denied
Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
Loading required package: MASS
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.