https://github.com/cran/spatstat
Raw File
Tip revision: 6414035503282ee13b6593e29986ffe78b84ff6a authored by Adrian Baddeley on 11 October 2011, 15:24:29 UTC
version 1.23-6
Tip revision: 6414035
NAinCov.R
# tests/NAinCov.R
# Testing the response to the presence of NA's in covariates

require(spatstat)
X <- runifpoint(42)
Y <- as.im(function(x,y) { x+y }, owin())
Y[owin(c(0.2,0.4),c(0.2,0.4))] <- NA
# fit model: should produce a warning but no failure
misfit <- ppm(X, ~Y, covariates=list(Y=Y))
# prediction 
Z <- predict(misfit, type="trend")
Z <- predict(misfit, type="se")
# covariance matrix: all should be silent
v <- vcov(misfit)
ss <- vcov(misfit, what="internals")





back to top