简体   繁体   English

线性混合加权回归中 R^2 的 95% CI

[英]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.

相关问题 R 中具有对数变换的线性混合模型:计算标准偏差或 95%CI 以获取特定估计值及其对比 - linear mixed model with log-transformation in R: Compute standard deviation or 95%CI for specific estimates and their contrasts 回归时 95% CI 的方程? - Equation for 95% CI on regression? 如何计算R中线性回归模型中斜率的95%置信区间 - How to calculate the 95% confidence interval for the slope in a linear regression model in R R仿真中线性回归和线性混合模型中的偏差估计 - Estimating bias in linear regression and linear mixed model in R simulation 以 95% CI 重复回归进行估计 - repeated regression with 95% CI for estimates 解释线性混合效应模型中两个水平因子之间的模型估计差异的95%CI - Interpreting 95% CI for model estimated difference between two level factor in linear mixed-effects model 在线性混合 model 的预测回归线周围绘制 95% 置信区间带 - Plotting a 95% confidence interval band around a predicted regression line from a linear mixed model 使用 lm() 和 svyglm() 在 R 中进行加权线性回归。 相同的模型,不同的结果 - Weighted linear regression in R with lm() and svyglm(). Same model, different results 在 R 中使用 tbl_regression function 的一列中具有 95%CI 的回归系数? - Regression coefficient with 95%CI in one column using tbl_regression function in R? 从 R 中的混合效应线性回归模型中装袋 AIC 值 - bagging AIC values from mixed effects linear regression models in R
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM