"rstanarm" 包中的 stan_glm() 对象中可提取的 "linear.predictors" 是什么?
What is "linear.predictors" as extractable from stan_glm() object in "rstanarm" package?
我写信是想了解 "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
stanreg-objects
的文档中有什么不清楚的地方?
...
fitted.values
Fitted mean values. For GLMs the linear predictors are transformed by the inverse link function.
linear.predictors
Linear fit on the link scale. For linear models this is the same as fitted.values.
...
我写信是想了解 "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
stanreg-objects
的文档中有什么不清楚的地方?
...
fitted.values
Fitted mean values. For GLMs the linear predictors are transformed by the inverse link function.
linear.predictors
Linear fit on the link scale. For linear models this is the same as fitted.values.
...