问题
Is it possible to include weights in a poisson point process model fitted to a logistic regression quadrature scheme? My data is a stratified sample and I would like to account for this sampling strategy in order to have valid population level predictions.
回答1:
Here are a few lines to elaborate on the answer by @adrian-baddeley.
If you have the setup of your related question and we imagine you have the weights and two covariates in a data.frame
in the same order as the points of your quadscheme
:
library(spatstat)
X <- split(chorley)$larynx
D <- split(chorley)$lung
Q <- quadscheme.logi(X,D)
covar <- data.frame(weights = runif(npoints(chorley)),
covar1 = rnorm(npoints(chorley)),
covar2 = rnorm(npoints(chorley)))
fit <- ppm(Q ~ offset(log(weights)) + covar1 + covar2, data = covar)
回答2:
This is a question about the model-fitting function ppm
in the R package spatstat
.
Yes, you can include survey weights. The easiest way is to create a covariate surveyweight
, which could be a function(x,y)
or a pixel image or a column of data associated with your quadrature scheme. Then when fitting the model using ppm
, add the model term +offset(log(surveyweight))
.
The result of ppm
will be a fitted model that describes the observed point pattern. You can do prediction, simulation etc from this model, but be aware that these will be predictions or simulations of the observed point process including the effect of non-constant survey effort.
To get a prediction or simulation of the original point process (i.e. after removing the effect of non-constant survey effort) you need to replace the original covariate surveyweight
by another covariate that is constant and equal to 1, then pass this to predict.ppm
in the argument newdata
.
来源:https://stackoverflow.com/questions/58904090/how-can-i-include-survey-weights-in-a-poisson-pint-process-model-fitted-to-a-log