r语言 - 从包中的 stan_glm() 对象中提取"linear.predictors" "rstanarm"是什么?



我写信是为了找出返回的"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拟合平均值。对于 GLM,线性预测变量由逆链接函数变换。
linear.predictors 链接刻度上的线性拟合。对于线性模型,这与拟合值相同。
...

最新更新