正在尝试运行
cld(posthoc, alpha=.05, Letters=letters)为我的数据获取字母值的代码,但会产生以下错误:
UseMethod("cld")中出错:没有适用于"c('emm_list','list')“类的对象的”cld“方法”
代码如下
install.packages("car")
arcdata<- read.csv(file.choose())
arcdata
dput(arcdata)
str(arcdata)
library(ggpubr)
plot<- ggline(arcdata, x="preg", y="arc", color = "herd",
add =c("mean_se", "dotplot"), palette= c("#00AFBB", "#E7B800"))
plot
model1<-lm(arc~herd*preg, data = arcdata)
anova(model1)
plot(model1, 2)
aov_residuals<-residuals(object = model1)
shapiro.test(aov_residuals)
plot(model1, 1)
leveneTest(arc~herd*preg, data= arcdata)
install.packages("lsmeans")
install.packages("multcompView")
library("lsmeans")
library("multcompView")
posthoc<-lsmeans(model1, pairwise~herd*preg, adjust="tukey")
posthoc
cld(posthoc,
alpha=.05,
Letters=letters)代码的最后一部分(cld)没有生成预期的字母组,这可能与alpha=.05有关吗?
发布于 2019-11-26 19:29:47
试试这个:
posthoc<-lsmeans(model1, ~herd*preg, adjust="tukey")发布于 2021-02-07 01:25:31
posthoc<-emmeans(model1, pairwise~herd*preg, adjust="tukey")查看'posthoc‘的输出,您会发现两个部分($emmeans和$contrasts)。或者,您可以使用names(posthoc)获取它。
不应包含contrasts
所以使用:
CLD(posthoc$emmeans,
alpha=.05,
Letters=letters)https://stackoverflow.com/questions/55993473
复制相似问题