我写信是为了找出对象"linear.predictors"返回的
内容stan_glm()。
显然,"linear.predictors"与用户提供的预测变量不同(文档没有帮助)。
无论如何,有没有办法从stan_glm()对象中获取预测值?
这是一个单一的预测器(即 mom_iq)示例:
library(rstanarm)
data(kidiq)
d <- kidiq
fit <-stan_glm(kid_score ~ mom_iq,
data = d,
prior = normal(0, 2.5),
prior_intercept = normal(0, 10),
prior_aux = cauchy(0, 100))
max(fit$linear.predictors) # 110.5605 # As can be seen, these are not the same
max(d$mom_iq) # 138.8931