首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在R中使用Bonferroni过程时,LSD值为null

在R中使用Bonferroni过程时,LSD值为null
EN

Stack Overflow用户
提问于 2020-09-24 06:47:20
回答 1查看 179关注 0票数 0

在使用Bonferroni的程序时,我在寻找LSD的值时遇到了一个问题。它返回NULL,你能帮我解决这个问题吗?非常感谢。

代码语言:javascript
复制
library(agricolae)

# Input the treatments and responses
trt <- c(rep("P", 4), rep("T", 4), rep("S", 4), rep("E", 4), rep("C",4))
response <- c(29.6, 24.3, 28.5, 32, 27.3, 32.6, 30.8, 34.8, 5.8, 6.2, 11, 8.3, 
             21.6, 17.4, 18.3, 19, 29.2, 32.8, 25, 24.2)
trt <- as.factor(trt)

df <- data.frame(trt, response)
model <- aov(response ~ trt, data = df)
out <- LSD.test(model, "trt", p.adj = "bonferroni")
out

# Obtain the LSD value
out$statistics$LSD

EN

回答 1

Stack Overflow用户

发布于 2020-09-24 16:44:39

不幸的是,它并没有很好的文档记录。您可以检查code for LSD.test,然后您就拥有了:

代码语言:javascript
复制
   if (length(nr) == 1 & p.adj == "none") 
        statistics <- data.frame(statistics, t.value = Tprob, 
            LSD = LSD)
    if (length(nr) == 1 & p.adj != "none") 
        statistics <- data.frame(statistics, t.value = Tprob, 
            MSD = LSD)

因此,当您的p.adjust不是"none"时,它会将列名改为MSD,这意味着最小的显著差异。您也可以切换到控制台(选项console =TRUE)来查看这一点。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64037263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档