library(spatstat) ############# # Null model ############# null <- ppm(outbreaks.ppp, ~1) summary(null) ###################### # Inhomogeneous model ###################### inhom <- ppm(outbreaks.ppp, ~ x + y) summary(inhom) valid.ppm(inhom) # To gnerate likelihood ratio test for models above: LR.1 <- anova(null, inhom) summary(LR.1) AIC(null) AIC(inhom) #################################### ## Covariate Model with Interaction #################################### # popmgvf.img = pixel image for population density:MGVF interaction # bio1.africa.30.img = pixel image for mean annual temperature # bio12.africa.30.img = pixel image for mean annual precipitation # mgvf.2001.africa.img = pixel image for MGVF # popdens2000.africa.30.img = pixwl image for population density # alt.africa.30.img = pixel image for altitude spatial.m.int <- ppm(outbreaks.ppp, ~Cov1 + Cov2 + Cov3 + Cov4 + Cov5 + Cov6, covariates = list(Cov1 = popmgvf.img, Cov2 = bio1.africa.30.img, Cov3 = bio12.africa.30.img, Cov4 = mgvf.2001.africa.img, Cov5 = popdens2000.africa.30.img, Cov6 = alt.africa.30.img)) spatial.m.int exp(coef(spatial.m.int)) exp(confint(spatial.m.int)) AIC(spatial.m.int) valid.ppm(spatial.m.int) pInteract <- predict.ppm(spatial.m.int, covariates = list(Cov1 = popmgvf.img, Cov2 = bio1.africa.30.img, Cov3 = bio12.africa.30.img, Cov4 = mgvf.2001.africa.img, Cov5 = popdens2000.africa.30.img, Cov6 = alt.africa.30.img))