【发布时间】:2019-09-23 09:32:00
【问题描述】:
尝试运行
cld(posthoc, alpha=.05, Letters=letters)
获取我的数据的字母值的代码,但产生此错误:
UseMethod("cld") 中的错误: 没有适用于“cld”的方法应用于“c('emm_list', 'list')”类的对象
代码如下
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 有关吗?
【问题讨论】:
-
我认为
cld(posthoc[[1]])会起作用。
标签: r