我运行了以下模型:
log <- svyglm(compo ~ bs(edadc,degree=1, knots =c(-1,8)) +
numenf5 + BMIc + BMIc2 + fried,
dclus,family = quasibinomial)
当我尝试计算 edadc=0 的 logits 时,我会得到不同的结果:
newdata2 <- with(compoc,
data.frame(edadc = rep(seq(from = -1, to = 0))))
newdata2$BMIc<-0
newdata2$BMIc2<-0
newdata2$numenf5<-2
newdata2$fried<-"R"
newdata2 <- cbind(newdata2, predict(log, newdata2,
type = "link",se= TRUE))
edadc BMIc BMIc2 numenf5 fried link SE
1 -1 0 0 2 R -0.8689483 0.1319695
2 0 0 0 2 R -0.2217048 0.1569442
当我写:
newdata2 <- with(compoc,
data.frame(edadc = rep(seq(from = -1, to = 1))))
newdata2$BMIc<-0
newdata2$BMIc2<-0
newdata2$numenf5<-2
newdata2$fried<-"R"
newdata2 <- cbind(newdata2, predict(log,
newdata2, type = "link",se= TRUE))
edadc BMIc BMIc2 numenf5 fried link SE
1 -1 0 0 2 R -0.8689483 0.1319695
2 0 0 0 2 R -0.5453266 0.1021396
3 1 0 0 2 R -0.2217048 0.1569442
当我在 newdata2 中为 edadc 引入正值时,会发生不同的链接计算。