如何在符合逻辑回归正交方案的泊松品脱过程模型中包括调查权重? [英] How can I include survey weights in a poisson pint process model fitted to a logistic regression quadrature scheme?
本文介绍了如何在符合逻辑回归正交方案的泊松品脱过程模型中包括调查权重?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在符合逻辑回归正交方案的泊松点过程模型中包含权重?我的数据是分层样本,我想说明这种抽样策略,以便获得有效的人口水平预测.
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.
推荐答案
以下是@ adrian-baddeley回答的几行内容.
Here are a few lines to elaborate on the answer by @adrian-baddeley.
如果您已经设置了相关问题,并且我们假设您在quadscheme
点的顺序相同:
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)
这篇关于如何在符合逻辑回归正交方案的泊松品脱过程模型中包括调查权重?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文