I use the package languageR
for mixed effect models with the syntax at the end of this posting. I can use pvals.fnc
to get p -values for models 1 and 3 ( hd_lmer1
and hd_lmer2
). Using this with model two gives the following error message:
p2 = pvals.fnc(hd_lmer2) Error in pvals.fnc(hd_lmer2) : MCMC sampling is not yet implemented in lme4_0.999375 for models with random correlation parameters
I would be grateful if any one could help me out on how to get p-values for such models.
Models:
hd_lmer1 <- lmer(
rot ~ time + group + sex + gen + (1 | subject) + (1 | rot.pre),
data = data_long,
REML = TRUE
)
hd_lmer2 <- lmer(
rot ~ time + group + sex + gen + (time | subject) + (1 | rot.pre),
data = data_long,
REML = TRUE
)
hd_lmer3 <- lmer(
rot ~ time * group + sex + gen + (1 | subject) + (1 | rot.pre),
data = data_long,
REML = TRUE
)
It is an old post but here is one possible solution that can be helpful, using a model comparison method to test if hd_lmer2 produces a better fit than hdlmer1 (ie, if the addition of the random effect is significative or not).
hdlmer1ml<-update(hdlmer1,REML=FALSE)
hdlmer2ml<-update(hdlmer2,REML=FALSE)
anova(hdlmer2ml,hdlmer1ml)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.