Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 使用方法错误(“cld”):没有适用于';cld&x27;适用于“类”的对象;c(';emm#U列表';,';列表';);_R - Fatal编程技术网

R 使用方法错误(“cld”):没有适用于';cld&x27;适用于“类”的对象;c(';emm#U列表';,';列表';);

R 使用方法错误(“cld”):没有适用于';cld&x27;适用于“类”的对象;c(';emm#U列表';,';列表';);,r,R,试图运行 cld(posthoc, alpha=.05, Letters=letters) 代码以获取我的数据的字母值,但产生以下错误: UseMethod(“cld”)中的错误: 没有适用于“c”类对象的“cld”方法(“emm_列表”、“列表”) 代码如下 install.packages("car") arcdata<- read.csv(file.choose()) arcdata dput(arcdata) str(arcdata) library(ggpubr) plot

试图运行

cld(posthoc, alpha=.05, Letters=letters)
代码以获取我的数据的字母值,但产生以下错误:

UseMethod(“cld”)中的错误: 没有适用于“c”类对象的“cld”方法(“emm_列表”、“列表”)

代码如下

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)

install.packages(“汽车”)
arcdata尝试以下方法:

posthoc<-lsmeans(model1, ~herd*preg, adjust="tukey")

posthocI认为
cld(posthoc[[1]])
会起作用。你能详细说明原因吗?这似乎是由于lsmeans到emmeans的转换,以及成对比较。如果在herd或preg上运行cld(),它应该可以工作,但尝试测试交互效果似乎失败了。
posthoc<-emmeans(model1, pairwise~herd*preg, adjust="tukey")
CLD(posthoc$emmeans, 
    alpha=.05,
    Letters=letters)