首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >R中的缺失值与LSD

R中的缺失值与LSD
EN

Stack Overflow用户
提问于 2021-02-03 16:28:57
回答 1查看 228关注 0票数 0

在数据帧中删除NA值后,我一直试图在R中获得LSD值。但是在R中没有缺少值,我仍然无法得到LSD值。有什么方法可以让我得到LSD值吗?

代码语言:javascript
复制
structure(list(Entry_No = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 
2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 
8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 11L, 11L, 
11L, 11L, 12L, 12L, 12L, 12L), .Label = c("1", "2", "3", "4", 
"5", "6", "7", "8", "9", "10", "11", "12"), class = "factor"), 
Rep = c(2, 3, 4, 1, 2, 3, 4, 1, 3, 4, 2, 3, 4, 2, 1, 2, 3, 
4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 
3, 4, 1, 2, 3, 4), `Fall Vigor` = c(5, 4, 6, 4, 4, 3, 4, 
5, 4, 4, 3, 5, 4, 4, 4, 5, 5, 4, 5, 5, 8, 5, 5, 3, 5, 7, 
5, 5, 5, 4, 3, 4, 3, 4, 4, 3, 4, 6, 5, 5, 4, 9), `Fall Biomass` = c(8, 
5, 5, 8, 5, 6, 7, 9, 7, 4, 5, 8, 7, 5, 6, 5, 4, 5, 9, 7, 
8, 7, 3, 6, 6, 6, 4, 7, 9, 6, 5, 4, 5, 7, 6, NA, 7, 8, 6, 
8, 7, 8), FrzDmg = c(8, 7, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 
7, 8, 8, 7, 8, 9, 7, 8, 8, 7, 9, 8, 8, 8, 8, 8, 8, 8, 8, 
9, 9, 8, 7, 8, 8, 7, 8, 8, 7, 8), `Spring Vigor` = c(8, 5, 
5, 8, 5, 6, 7, 9, 7, 4, 5, 8, 7, 5, 6, 5, 4, 5, 9, 7, 8, 
7, 3, 6, 6, 6, 4, 7, 9, 6, 5, 4, 5, 7, 6, NA, 7, 8, 6, 8, 
7, 8), `Spring Re-growth` = c(5.43993875562567, 1.77735165749421, 
3.62893796687236, 3.7239363429685, 3.29870551663342, 1.8493017213381, 
3.93952449443564, 3.07002362446445, 4.39465503642184, 1.38189829972876, 
2.62164242839787, 7.28355491190987, 10, 1.83194399336004, 
0.597735814039809, 0.723117529470425, 0.50174852904522, 0.947105022291771, 
6.4138982972208, 4.58926241735981, 4.8332792032045, 4.1021520999641, 
0.637160825533674, 1.59340271403759, 3.78698711702934, 2.25885027606366, 
2.34614608112497, 4.19895795690022, 4.29287106203313, 4.26678420637498, 
1.03815218844927, 0.426981948475102, 0.455614102272011, 1.41296435251033, 
1.60649348574958, 0.0997406460783899, 1.94273032369817, 4.29707834535632, 
1.04538297408743, 3.2926823689784, 1.84085742124066, 4.21825267944138
)), row.names = c(NA, -42L), class = c("tbl_df", "tbl", "data.frame")

`model3<-aov(`FrzDmg`~Entry_No, data=RF)
out3 <- LSD.test(model3,"Entry_No", p.adj="none",console=TRUE)
out3`

我在没有LSD的情况下得到这些结果

MSerror Df均值CV 2.519878 70 5.006944 31.70421

这些是我得到的价值。有一个丢失的值,我省略了它,但我仍然无法得到它的LSD值。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-02-05 12:45:03

根据你提供的一些小信息,很难理解你的问题是什么,但我得到以下信息。

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

# Data
RF <- structure(list(Entry_No = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 
                                      2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 
                                      8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 11L, 11L, 
                                      11L, 11L, 12L, 12L, 12L, 12L), .Label = c("1", "2", "3", "4", 
                                                                                "5", "6", "7", "8", "9", "10", "11", "12"), class = "factor"), 
               Rep = c(2, 3, 4, 1, 2, 3, 4, 1, 3, 4, 2, 3, 4, 2, 1, 2, 3, 
                       4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 
                       3, 4, 1, 2, 3, 4), `Fall Vigor` = c(5, 4, 6, 4, 4, 3, 4, 
                                                           5, 4, 4, 3, 5, 4, 4, 4, 5, 5, 4, 5, 5, 8, 5, 5, 3, 5, 7, 
                                                           5, 5, 5, 4, 3, 4, 3, 4, 4, 3, 4, 6, 5, 5, 4, 9), `Fall Biomass` = c(8, 
                                                                                                                               5, 5, 8, 5, 6, 7, 9, 7, 4, 5, 8, 7, 5, 6, 5, 4, 5, 9, 7, 
                                                                                                                               8, 7, 3, 6, 6, 6, 4, 7, 9, 6, 5, 4, 5, 7, 6, NA, 7, 8, 6, 
                                                                                                                               8, 7, 8), FrzDmg = c(8, 7, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 
                                                                                                                                                    7, 8, 8, 7, 8, 9, 7, 8, 8, 7, 9, 8, 8, 8, 8, 8, 8, 8, 8, 
                                                                                                                                                    9, 9, 8, 7, 8, 8, 7, 8, 8, 7, 8), `Spring Vigor` = c(8, 5, 
                                                                                                                                                                                                         5, 8, 5, 6, 7, 9, 7, 4, 5, 8, 7, 5, 6, 5, 4, 5, 9, 7, 8, 
                                                                                                                                                                                                         7, 3, 6, 6, 6, 4, 7, 9, 6, 5, 4, 5, 7, 6, NA, 7, 8, 6, 8, 
                                                                                                                                                                                                         7, 8), `Spring Re-growth` = c(5.43993875562567, 1.77735165749421, 
                                                                                                                                                                                                                                       3.62893796687236, 3.7239363429685, 3.29870551663342, 1.8493017213381, 
                                                                                                                                                                                                                                       3.93952449443564, 3.07002362446445, 4.39465503642184, 1.38189829972876, 
                                                                                                                                                                                                                                       2.62164242839787, 7.28355491190987, 10, 1.83194399336004, 
                                                                                                                                                                                                                                       0.597735814039809, 0.723117529470425, 0.50174852904522, 0.947105022291771, 
                                                                                                                                                                                                                                       6.4138982972208, 4.58926241735981, 4.8332792032045, 4.1021520999641, 
                                                                                                                                                                                                                                       0.637160825533674, 1.59340271403759, 3.78698711702934, 2.25885027606366, 
                                                                                                                                                                                                                                       2.34614608112497, 4.19895795690022, 4.29287106203313, 4.26678420637498, 
                                                                                                                                                                                                                                       1.03815218844927, 0.426981948475102, 0.455614102272011, 1.41296435251033, 
                                                                                                                                                                                                                                       1.60649348574958, 0.0997406460783899, 1.94273032369817, 4.29707834535632, 
                                                                                                                                                                                                                                       1.04538297408743, 3.2926823689784, 1.84085742124066, 4.21825267944138
                                                                                                                                                                                                         )), row.names = c(NA, -42L), class = c("tbl_df", "tbl", "data.frame"))
          
RF <- na.omit(RF)
model3 <-aov(`FrzDmg`~Entry_No, data=RF)
out3   <- LSD.test(model3,"Entry_No", p.adj="none",console=TRUE)

为此,我得到了以下输出:

代码语言:javascript
复制
out3

    Study: model3 ~ "Entry_No"

LSD t Test for FrzDmg 

Mean Square Error:  0.2844828 

Entry_No,  means and individual ( 95 %) CI

     FrzDmg       std r      LCL      UCL Min Max
1  7.666667 0.5773503 3 7.036857 8.296476   7   8
10 8.500000 0.5773503 4 7.954569 9.045431   8   9
11 7.333333 0.5773503 3 6.703524 7.963143   7   8
12 7.750000 0.5000000 4 7.204569 8.295431   7   8
2  7.750000 0.5000000 4 7.204569 8.295431   7   8
3  8.000000 0.0000000 3 7.370190 8.629810   8   8
4  7.666667 0.5773503 3 7.036857 8.296476   7   8
5  8.000000        NA 1 6.909137 9.090863   8   8
6  8.000000 0.8164966 4 7.454569 8.545431   7   9
7  7.500000 0.5773503 4 6.954569 8.045431   7   8
8  8.250000 0.5000000 4 7.704569 8.795431   8   9
9  8.000000 0.0000000 4 7.454569 8.545431   8   8

Alpha: 0.05 ; DF Error: 29
Critical Value of t: 2.04523 

Groups according to probability of means differences and alpha level( 0.05 )

Treatments with the same letter are not significantly different.

     FrzDmg groups
10 8.500000      a
8  8.250000     ab
3  8.000000    abc
5  8.000000    abc
6  8.000000    abc
9  8.000000    abc
12 7.750000    abc
2  7.750000    abc
1  7.666667     bc
4  7.666667     bc
7  7.500000     bc
11 7.333333      c

如果这不是您所期望的输出,则需要更具体地说明这一点。

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

https://stackoverflow.com/questions/66031665

复制
相关文章

相似问题

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