[英]95% CI of R^2 in a linear mixed weighted regression
I am trying to calculate the R^2 and its 95%CI in linear mixed weighted regression.我正在尝试在线性混合加权回归中计算 R^2 及其 95% CI。 Since the summary of lme() doesn't provide R^2, I am using the r.squaredGLMM() from MuMIn package, and boot() from boot package.由于LME纪要()没有提供R ^ 2,我使用从牧民包和引导()的r.squaredGLMM()从引导软件包。 (If you have better way to do this, please let me know!!!) However, I found the upper and lower bound to be the same number. (如果你有更好的方法来做到这一点,请告诉我!!!)但是,我发现上限和下限是相同的数字。 Why?为什么? I am using the mtcars data as an example here:我在这里使用 mtcars 数据作为示例:
library(lme4)
library(boot)
library(MuMIn)
foo <- boot(mtcars, function(data, indices)
r.squaredGLMM(lme(mpg ~ wt, data=mtcars,
random= ~1|gear, weights= ~carb))[1], R=1000)
foo$t0
quantile(foo$t, c(0.025, 0.975))
原来我忘了添加data=mtcars[indices,]
... 我想删除这个问题,但我想也许它可以帮助 R 的新人有类似的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.