问题描述
列表.
我有一个使用lmer.test软件包并调用glmer的广义混合模型.我可以得到一个好的模型,但是我不能得到LSMEANS和Diff平均值的输出.
I have a generalized mixed model using lmer.test package and calling glmer. I can get a good model, however I can't get the output of the LSMEANS and Diff means.
这就是我所拥有的
library(plyr)
library(lubridate)
library(chron)
library(reshape)
library(lattice)
library(car)
library(lmerTest)
fm17<-glmer(I(Steps+1)~Treatment + treatdate +Weight + BF+ (1|Block) +(0+treatdate|exp.unit), family=poisson)
summary(fm17,ddf="Kenward-Roger")
qqnorm(resid(fm17),main="QQ Model 17")
plot(fm17,main="Residual Model 17")
anova(fm17, ddf="Kenward-Roger")
lsmeans(fm17)
difflsmeans(fm17)
一切正常,直到LSMEANS声明
Everything runs fine until LSMEANS statement
这是输出 摘要(fm17,ddf ="Kenward-Roger") qqnorm(resid(fm17),main ="QQ模型17") 情节(fm17,main =剩余模型17") 方差分析(fm17,ddf ="Kenward-Roger")以上所有工作正常
Here's the output summary(fm17,ddf="Kenward-Roger") qqnorm(resid(fm17),main="QQ Model 17") plot(fm17,main="Residual Model 17") anova(fm17, ddf="Kenward-Roger")All the above work fine
任何有关如何获得该输出的帮助将不胜感激.
Any help on how to get that output back would be much appreciated.
推荐答案
lsmeans 软件包确实支持glmerMod
对象,但不支持这些模型的Kenward-Rogers df(这些依赖的 pbkrtest 软件包).您想要lsmeans的哪些因素?您需要在通话中为其命名.做这样的事情
The lsmeans package does support glmerMod
objects, but it does not support Kenward-Rogers df for these models(nor does the pbkrtest package that these rely on). What factors do you want lsmeans of? You need to name them in the call. Do something like this
detach(lmerTest)
library(lsmeans)
lsmeans(fm17, "Treatment")
pairs(.Last.value)
df在结果中显示为NA
,表明已使用渐近结果($ z $检验和CI).
The df show as NA
in the results, indicating that asymptotic results ($z$ tests and CIs) are used.
这篇关于我无法在glmer中获得lsmeans的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!