全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
11635 5
2015-01-22
求教:
请问形如模型:
library(lme4)
Km2<-lmer(y~1+(1|subject),w)
的结果:[img=0,1]file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\123558526\QQ\WinTemp\RichOle\S%}VX@L]4%MK@0$R[GIXLIR.png[/img]
Linear mixed model fit by REML ['lmerMod']
Formula: y ~ 1 + (1 | subject)
   Data: w

REML criterion at convergence: 33380.49

Random effects:
   Groups   Name        Variance Std.Dev.   
subject  (Intercept) 1.186    1.089      
   Residual                  5.635    2.374         
Number of obs: 7072, groups: subject, 1768

Fixed effects:
            Estimate Std. Error t value              
(Intercept)  2.19595    0.03831   57.32     


怎样计算随机效应方差、协方差部分以及固定效应系数部分的P值(红色部分)?
求大神指教,不甚感激~

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-1-23 13:41:53
这个函数命令里面还真是有p-value的,前缀给出来就好了——
p.values.lmer(lmer.out)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-1-26 09:24:32
DM小菜鸟 发表于 2015-1-23 13:41
这个函数命令里面还真是有p-value的,前缀给出来就好了——
p.values.lmer(lmer.out)
非常感谢您的答案,但是我用了之后还是错误,显示没有“p.values.lmer”这个函数,该怎么修改呢?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-1-26 10:03:25
DM小菜鸟 发表于 2015-1-23 13:41
这个函数命令里面还真是有p-value的,前缀给出来就好了——
p.values.lmer(lmer.out)
我找到了原程序,再看看,如果还有不懂的地方,还请多指教~谢谢~
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-3-17 10:38:42
我也遇到同样的问题,解决没有啊
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2018-3-28 10:21:12

pvalues {lme4}        R Documentation
Getting p-values for fitted models

Description

One of the most frequently asked questions about lme4 is "how do I calculate p-values for estimated parameters?" Previous versions of lme4 provided the mcmcsamp function, which efficiently generated a Markov chain Monte Carlo sample from the posterior distribution of the parameters, assuming flat (scaled likelihood) priors. Due to difficulty in constructing a version of mcmcsamp that was reliable even in cases where the estimated random effect variances were near zero (e.g. https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q4/003115.html), mcmcsamp has been withdrawn (or more precisely, not updated to work with lme4 versions >=1.0.0).

Many users, including users of the aovlmer.fnc function from the languageR package which relies on mcmcsamp, will be deeply disappointed by this lacuna. Users who need p-values have a variety of options. In the list below, the methods marked MC provide explicit model comparisons; CI denotes confidence intervals; and P denotes parameter-level or sequential tests of all effects in a model. The starred (*) suggestions provide finite-size corrections (important when the number of groups is <50); those marked (+) support GLMMs as well as LMMs.

likelihood ratio tests via anova or drop1 (MC,+)

profile confidence intervals via profile.merMod and confint.merMod (CI,+)

parametric bootstrap confidence intervals and model comparisons via bootMer (or PBmodcomp in the pbkrtest package) (MC/CI,*,+)

for random effects, simulation tests via the RLRsim package (MC,*)

for fixed effects, F tests via Kenward-Roger approximation using KRmodcomp from the pbkrtest package (MC,*)

car::Anova and lmerTest::anova provide wrappers for Kenward-Roger-corrected tests using pbkrtest: lmerTest::anova also provides t tests via the Satterthwaite approximation (P,*)

afex::mixed is another wrapper for pbkrtest and anova providing "Type 3" tests of all effects (P,*,+)

arm::sim, or bootMer, can be used to compute confidence intervals on predictions.

For glmer models, the summary output provides p-values based on asymptotic Wald tests (P); while this is standard practice for generalized linear models, these tests make assumptions both about the shape of the log-likelihood surface and about the accuracy of a chi-squared approximation to differences in log-likelihoods.

When all else fails, don't forget to keep p-values in perspective: http://www.phdcomics.com/comics/archive.php?comicid=905
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群