I am trying to bootstrap a spatial autologistic regression model I've run. I get different coefficients than my original model, however I'm getting zero bias and zero standard error:
Call:
boot(data = SpatModelData, statistic = logit_test, R = 10000)
Bootstrap Statistics :
original bias std. error
t1* -9.61446203999 0 0
t2* 0.00204855993 0 0
t3* -0.00006460087 0 0
t4* 0.44715200453 0 0
t5* 0.00006142740 0 0
t6* 0.00237036752 0 0
t7* -0.27383819088 0 0
t8* 3.74004003319 0 0
Can anyone explain this or help with code? I think it's something to do with my function statement based on what I read here (https://stackoverflow.com/questions/27595014/bootstrap-code-not-reporting-bias-or-standard-error).
Here is my code:
# read about bootstrapping
?boot
# load the bootstrap library
library(boot)
# create the bootstrap function
logit_test <- function(d,indices) {d <- d[indices,]
fit <- glm(Skunk ~ EVI+ROADDIST+SPECIES_1+POP+PRECIP+SLOPE+AUTOCOV,data = SpatModelData, family = binomial("logit"))
return(coef(fit))}
# run the bootstrapping
BootResults <-boot(data=SpatModelData,statistic=logit_test, R=10000)
#view the results
BootResults
Also when I look at the results of the bootstrapping, they're the same for all 10000 iterations
> BootResults$t
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] -9.614462 0.00204856 -0.00006460087 0.447152 0.0000614274 0.002370368 -0.2738382 3.74004
[2,] -9.614462 0.00204856 -0.00006460087 0.447152 0.0000614274 0.002370368 -0.2738382 3.74004
[3,] -9.614462 0.00204856 -0.00006460087 0.447152 0.0000614274 0.002370368 -0.2738382 3.74004
[4,] -9.614462 0.00204856 -0.00006460087 0.447152 0.0000614274 0.002370368 -0.2738382 3.74004
[5,] -9.614462 0.00204856 -0.00006460087 0.447152 0.0000614274 0.002370368 -0.2738382 3.74004
When I look at each of the individual columns of the boot object they are null
#view the results
BootResults$t3
> BootResults$t3
NULL
The "SpatModelData" is a data frame of point locations of the presence/absence of rabid animals along with environmental covariates like temperature, elevation, land cover, etc. I've cleaned the data so there are no missing values in each of these observations. The original spatial model (pre bootstrap) has 860 observations, 430 of which are where there are known positive animals, 430 of which are controls with pseudo-absence. That is I laid a hexagon grid across my study area, generated hexagon centroids, and randomly selected 430 of them to extract covariate raster values at each location.