Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/66.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 添加Tukey';s混合模型箱线图的测试字母_R_Boxplot_Mixed Models_Tukey - Fatal编程技术网

R 添加Tukey';s混合模型箱线图的测试字母

R 添加Tukey';s混合模型箱线图的测试字母,r,boxplot,mixed-models,tukey,R,Boxplot,Mixed Models,Tukey,使用中的代码,我一直试图将字母添加到箱线图中,但aov函数对我的模型不起作用,因为它位于lmer而不是lm下 当我使用anova函数而不是aov时,代码的其余部分将无法工作。我可以在那里做任何替代品吗?来自packagemultcomp的cld(紧凑字母显示)可以对不同类型的型号进行替换 library("lme4") library("multcomp") data <- structure(list(Group = structure(c(1L, 1L, 1L, 1L, 1L, 1

使用中的代码,我一直试图将字母添加到箱线图中,但aov函数对我的模型不起作用,因为它位于lmer而不是lm下

当我使用anova函数而不是aov时,代码的其余部分将无法工作。我可以在那里做任何替代品吗?

来自packagemultcomp的
cld
(紧凑字母显示)可以对不同类型的型号进行替换

library("lme4")
library("multcomp")


data <- structure(list(Group = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L), .Label = c("G1", "G2", "G3"), class = "factor"), 
    Subject = structure(c(1L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 2L, 3L, 4L, 5L, 6L, 7L, 1L, 8L, 9L, 10L, 11L, 12L, 13L, 
    14L, 15L, 2L, 3L, 4L, 5L, 6L, 7L, 1L, 8L, 9L, 10L, 11L, 12L, 
    13L, 14L, 15L, 2L, 3L, 4L, 5L, 6L, 7L), .Label = c("S1", 
    "S10", "S11", "S12", "S13", "S14", "S15", "S2", "S3", "S4", 
    "S5", "S6", "S7", "S8", "S9"), class = "factor"), Value = c(9.83, 
    13.62, 13.2, 14.69, 9.27, 11.68, 14.65, 12.21, 11.58, 13.58, 
    12.49, 10.28, 12.22, 12.58, 15.43, 9.47, 11.47, 10.79, 10.66, 
    10.87, 12.98, 12.85, 8.67, 10.45, 13.62, 13.64, 12.46, 8.66, 
    10.66, 13.18, 11.97, 13.56, 11.83, 14.02, 11.38, 14.15, 13.22, 
    9.14, 11.66, 14.2, 14.18, 11.26, 11.98, 13.77, 11.57)), 
    row.names = c(NA, -45L), class = "data.frame")


model <- lmer (Value~Group + (1|Subject), data = data)
tuk <- glht(model, linfct = mcp(Group = "Tukey"))
tuk.cld <- cld(tuk)
plot(tuk.cld)
库(“lme4”)
图书馆(“multcomp”)
数据来自软件包multcomp
cld
(压缩字母显示)可用于不同型号

library("lme4")
library("multcomp")


data <- structure(list(Group = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L), .Label = c("G1", "G2", "G3"), class = "factor"), 
    Subject = structure(c(1L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 2L, 3L, 4L, 5L, 6L, 7L, 1L, 8L, 9L, 10L, 11L, 12L, 13L, 
    14L, 15L, 2L, 3L, 4L, 5L, 6L, 7L, 1L, 8L, 9L, 10L, 11L, 12L, 
    13L, 14L, 15L, 2L, 3L, 4L, 5L, 6L, 7L), .Label = c("S1", 
    "S10", "S11", "S12", "S13", "S14", "S15", "S2", "S3", "S4", 
    "S5", "S6", "S7", "S8", "S9"), class = "factor"), Value = c(9.83, 
    13.62, 13.2, 14.69, 9.27, 11.68, 14.65, 12.21, 11.58, 13.58, 
    12.49, 10.28, 12.22, 12.58, 15.43, 9.47, 11.47, 10.79, 10.66, 
    10.87, 12.98, 12.85, 8.67, 10.45, 13.62, 13.64, 12.46, 8.66, 
    10.66, 13.18, 11.97, 13.56, 11.83, 14.02, 11.38, 14.15, 13.22, 
    9.14, 11.66, 14.2, 14.18, 11.26, 11.98, 13.77, 11.57)), 
    row.names = c(NA, -45L), class = "data.frame")


model <- lmer (Value~Group + (1|Subject), data = data)
tuk <- glht(model, linfct = mcp(Group = "Tukey"))
tuk.cld <- cld(tuk)
plot(tuk.cld)
库(“lme4”)
图书馆(“multcomp”)

数据欢迎!你能让你的问题重现吗?欢迎!你能让你的问题重现吗