嵌套方差分析模型运行事后时出现“返回 NA”错误

问题描述 投票:0回答:1

我正在为我的嵌套方差分析模型运行 TukeyHSD 事后测试(响应=IAUC,因子=基因型+线,其中线嵌套在基因型中)。 但是我在运行 Tukey 字母的脚本时遇到错误(请在下面找到)。尽管输出给出了字母,但它们仍然与实际绘图(图 1-曲线下区域)不匹配,特别是对于最高但分配有字母“c”的 PsbS,可能是由于错误。我有另一个响应数据集(Image2-NPQ 600s),其中箱线图的分布/趋势看起来几乎与此类似,并且相同的脚本运行完美且无错误。 IAUC 的数据已经过检查,其因子/数字等元素已经过双重检查。可能出了什么问题?

IAUC plot.

Plot 2

数据集的dput:

> dput(IAUC)
structure(list(ID = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 
77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 
93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 
107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 
120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 
133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 
146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 
159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 
172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 
185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 
198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 
211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 
224, 225, 226, 227, 228, 229, 230, 231, 232), AUC = c(1128.8, 
683.9, 955.3, 989, 829.5, 951.5, 935.5, 714.6, 955.3, 787.6, 
830.1, 1019.4, 1121.6, 1057.6, 999.7, 922, 977.4, 719.5, 794.6, 
800.9, 818.2, 797.2, 905.5, 949, 736, 766.3, 784.3, 893.4, 827.8, 
858.6, 847, 779.1, 868.1, 935.9, 826.1, 1155.3, 920.4, 1127.1, 
779, 813.2, 930.8, 772.8, 1090.4, 589.2, 590.4, 781.6, 581.6, 
643, 662.8, 584.4, 726.2, 785.2, 604.5, 556.8, 559.9, 650.7, 
643, 738.2, 624.5, 661.4, 608.6, 648.4, 576.6, 637.7, 590.2, 
690.9, 724.6, 577.6, 683.4, 684.2, 651.7, 763.4, 728.5, 644.8, 
624.1, 696.7, 605.5, 632.2, 649.7, 652.6, 588.5, 554.3, 534.6, 
661.7, 654.3, 547.3, 685.5, 705.9, 734.2, 580.3, 597.9, 524.9, 
693.7, 698.5, 591.9, 582.6, 740.4, 565.2, 689.1, 656.5, 709.1, 
735.1, 684.4, 677.7, 600.5, 686.3, 579.9, 636.3, 667.7, 724.9, 
683.6, 532.5, 623.1, 494.9, 679.5, 360, 313.1, 396.4, 347.6, 
342.5, 351.8, 337.1, 351.5, 329.7, 348.4, 329.1, 347.4, 341.2, 
359.5, 294.7, 1869.9, 1775.1, 2080.8, 1934.5, 1676.5, 1869.9, 
1871.5, 1687.6, 1925, 1787.7, 2130.9, 1631.1, 1793.5, 1594.8, 
1496.2, 1684.1, 1974.5, 1726.2, 1887.7, 1624.4, 1505.5, 1807.4, 
1682, 1587.8, 1568.5, 1792.9, 1466.1, 1646.6, 1652, 1561, 2058.2, 
1746.5, 2079.8, 1535.2, 2013.7, 1483.1, 1584.6, 1931.2, 1706.5, 
1440.4, 1719.1, 973.3, 957.6, 885.9, 812.5, 1142.2, 790.6, 912.4, 
920.6, 1170.3, 1006.1, 877.8, 743.4, 839.2, 720.4, 827, 900.9, 
1000.4, 1087.2, 897.9, 951, 972.6, 789.8, 798.1, 843, 1126.7, 
847.8, 911, 1124.6, 762, 748.5, 843.3, 844.6, 1010.4, 1115.8, 
1110.2, 968.2, 800.9, 908.8, 754.8, 1028.6, 969.4, 1007.1, 888.6, 
894.1, 729.3, 729.4, 913.8, 1067.5, 1068.1, 1013.2, 1116.8, 1129.8, 
1058.3, 1072.7, 1158.6, 1126.8, 1097.6, 1082.7, 1141.3, 1147.8, 
1063.8), GENOTYPE = structure(c(4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 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, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 
7L, 7L, 7L, 7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 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 
12L, 12L, 12L, 12L, 12L), levels = c("1.1", "11.1", "2.1", "2.4", 
"3.4", "4.1", "5.2", "6.1", "7.1", "8.1", "9.1", "Col0", "npq4"
), class = "factor")), row.names = c(NA, -232L), spec = structure(list(
    cols = list(ID = structure(list(), class = c("collector_double", 
    "collector")), AUC = structure(list(), class = c("collector_double", 
    "collector")), GENOTYPE = structure(list(), class = c("collector_character", 
    "collector")), LINE = structure(list(), class = c("collector_character", 
    "collector"))), default = structure(list(), class = c("collector_guess", 
    "collector")), delim = ","), class = "col_spec"), problems = <pointer: 0x000002590af663d0>, class = c("spec_tbl_df", 
"tbl_df", "tbl", "data.frame"))

R 脚本及其用于数据检查、嵌套方差分析和事后分析的输出

IAUC <-read_CSV("C:/Users/IAUC")
Rows: 232 Columns: 4                                                                                                             
── Column specification ─────────────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (2): GENOTYPE, LINE
dbl (2): ID, AUC

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
> IAUC$GENOTYPE <- as.factor(IAUC$GENOTYPE)
> IAUC$LINE <- as.factor(IAUC$LINE)
> 
> str(IAUC)
spc_tbl_ [232 × 4] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
 $ ID      : num [1:232] 1 2 3 4 5 6 7 8 9 10 ...
 $ AUC     : num [1:232] 1129 684 955 989 830 ...
 $ GENOTYPE: Factor w/ 7 levels "Col0","npq4",..: 4 4 4 4 4 4 4 4 4 4 ...
 $ LINE    : Factor w/ 13 levels "1.1","11.1","2.1",..: 1 1 1 1 1 1 1 1 1 1 ...
 - attr(*, "spec")=
  .. cols(
  ..   ID = col_double(),
  ..   AUC = col_double(),
  ..   GENOTYPE = col_character(),
  ..   LINE = col_character()
  .. )
 - attr(*, "problems")=<externalptr> 

> IAUC_aov <- aov(AUC ~ GENOTYPE+ LINE %in% GENOTYPE, data = IAUC)
> summary(IAUC_aov)
               Df   Sum Sq Mean Sq F value Pr(>F)    
GENOTYPE        6 38762880 6460480 499.014 <2e-16 ***
GENOTYPE:LINE  10   256188   25619   1.979 0.0369 *  
Residuals     215  2783497   12946                   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

> th<-TukeyHSD(IAUC_aov, "GENOTYPE")
> p_values <- th$GENOTYPE[, "p adj"]
> p_adj_bonf <- p.adjust(p_values, method = "bonferroni")
> multcompLetters3("GENOTYPE", "AUC", p_adj_bonf, IAUC)
          Col0           npq4 PsbS (Control)          T259A          T259D          T259E          T259S 
           "a"            "b"            "c"            "d"            "e"            "e"            "d" 
Warning messages:
1: In mean.default(x = list(AUC = c(1067.5, 1068.1, 1013.2, 1116.8,  :
  argument is not numeric or logical: returning NA
2: In mean.default(x = list(AUC = c(360, 313.1, 396.4, 347.6, 342.5,  :
  argument is not numeric or logical: returning NA
3: In mean.default(x = list(AUC = c(1869.9, 1775.1, 2080.8, 1934.5,  :
  argument is not numeric or logical: returning NA
4: In mean.default(x = list(AUC = c(1128.8, 683.9, 955.3, 989, 829.5,  :
  argument is not numeric or logical: returning NA
5: In mean.default(x = list(AUC = c(589.2, 590.4, 781.6, 581.6, 643,  :
  argument is not numeric or logical: returning NA
6: In mean.default(x = list(AUC = c(763.4, 728.5, 644.8, 624.1, 696.7,  :
  argument is not numeric or logical: returning NA
7: In mean.default(x = list(AUC = c(973.3, 957.6, 885.9, 812.5, 1142.2,  :
  argument is not numeric or logical: returning NA
r ggplot2 anova tukey posthoc
1个回答
0
投票

问题是

multcompView
中的功能似乎不适用于小标题。 如果你在运行任何东西之前将其转换为数据框,
IAUC <- as.data.frame(IAUC)
,它应该可以工作。

IAUC <- structure(list(ID = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 
77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 
93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 
107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 
120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 
133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 
146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 
159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 
172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 
185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 
198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 
211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 
224, 225, 226, 227, 228, 229, 230, 231, 232), AUC = c(1128.8, 
683.9, 955.3, 989, 829.5, 951.5, 935.5, 714.6, 955.3, 787.6, 
830.1, 1019.4, 1121.6, 1057.6, 999.7, 922, 977.4, 719.5, 794.6, 
800.9, 818.2, 797.2, 905.5, 949, 736, 766.3, 784.3, 893.4, 827.8, 
858.6, 847, 779.1, 868.1, 935.9, 826.1, 1155.3, 920.4, 1127.1, 
779, 813.2, 930.8, 772.8, 1090.4, 589.2, 590.4, 781.6, 581.6, 
643, 662.8, 584.4, 726.2, 785.2, 604.5, 556.8, 559.9, 650.7, 
643, 738.2, 624.5, 661.4, 608.6, 648.4, 576.6, 637.7, 590.2, 
690.9, 724.6, 577.6, 683.4, 684.2, 651.7, 763.4, 728.5, 644.8, 
624.1, 696.7, 605.5, 632.2, 649.7, 652.6, 588.5, 554.3, 534.6, 
661.7, 654.3, 547.3, 685.5, 705.9, 734.2, 580.3, 597.9, 524.9, 
693.7, 698.5, 591.9, 582.6, 740.4, 565.2, 689.1, 656.5, 709.1, 
735.1, 684.4, 677.7, 600.5, 686.3, 579.9, 636.3, 667.7, 724.9, 
683.6, 532.5, 623.1, 494.9, 679.5, 360, 313.1, 396.4, 347.6, 
342.5, 351.8, 337.1, 351.5, 329.7, 348.4, 329.1, 347.4, 341.2, 
359.5, 294.7, 1869.9, 1775.1, 2080.8, 1934.5, 1676.5, 1869.9, 
1871.5, 1687.6, 1925, 1787.7, 2130.9, 1631.1, 1793.5, 1594.8, 
1496.2, 1684.1, 1974.5, 1726.2, 1887.7, 1624.4, 1505.5, 1807.4, 
1682, 1587.8, 1568.5, 1792.9, 1466.1, 1646.6, 1652, 1561, 2058.2, 
1746.5, 2079.8, 1535.2, 2013.7, 1483.1, 1584.6, 1931.2, 1706.5, 
1440.4, 1719.1, 973.3, 957.6, 885.9, 812.5, 1142.2, 790.6, 912.4, 
920.6, 1170.3, 1006.1, 877.8, 743.4, 839.2, 720.4, 827, 900.9, 
1000.4, 1087.2, 897.9, 951, 972.6, 789.8, 798.1, 843, 1126.7, 
847.8, 911, 1124.6, 762, 748.5, 843.3, 844.6, 1010.4, 1115.8, 
1110.2, 968.2, 800.9, 908.8, 754.8, 1028.6, 969.4, 1007.1, 888.6, 
894.1, 729.3, 729.4, 913.8, 1067.5, 1068.1, 1013.2, 1116.8, 1129.8, 
1058.3, 1072.7, 1158.6, 1126.8, 1097.6, 1082.7, 1141.3, 1147.8, 
1063.8), GENOTYPE = structure(c(4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,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L, 3L, 3L, 6L, 6L, 6L, 6L, 6L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 
5L, 5L, 5L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 
7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 
8L, 8L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 
13L, 13L, 13L, 13L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 
8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 
12L, 12L, 12L, 12L, 12L), levels = c("1.1", "11.1", "2.1", "2.4", 
"3.4", "4.1", "5.2", "6.1", "7.1", "8.1", "9.1", "Col0", "npq4"
), class = "factor")), row.names = c(NA, -232L), spec = structure(list(
    cols = list(ID = structure(list(), class = c("collector_double", 
    "collector")), AUC = structure(list(), class = c("collector_double", 
    "collector")), GENOTYPE = structure(list(), class = c("collector_character", 
    "collector")), LINE = structure(list(), class = c("collector_character", 
    "collector"))), default = structure(list(), class = c("collector_guess", 
    "collector")), delim = ","), class = "col_spec"),class = c("spec_tbl_df", 
"tbl_df", "tbl", "data.frame"))
IAUC <- as.data.frame(IAUC)

IAUC_aov <- aov(AUC ~ GENOTYPE+ LINE %in% GENOTYPE, data = IAUC)
summary(IAUC_aov)
#>                Df   Sum Sq Mean Sq F value Pr(>F)    
#> GENOTYPE        6 38762880 6460480 499.014 <2e-16 ***
#> GENOTYPE:LINE  10   256188   25619   1.979 0.0369 *  
#> Residuals     215  2783497   12946                   
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

th<-TukeyHSD(IAUC_aov, "GENOTYPE")
p_values <- th$GENOTYPE[, "p adj"]
p_adj_bonf <- p.adjust(p_values, method = "bonferroni")

library(multcompView)
multcompLetters3("GENOTYPE", "AUC", p_adj_bonf, IAUC)
#> PsbS (Control)           Col0          T259S          T259A          T259D 
#>            "a"            "b"            "c"            "c"            "d" 
#>          T259E           npq4 
#>            "d"            "e"

创建于 2024 年 12 月 20 日,使用 reprex v2.1.0

© www.soinside.com 2019 - 2024. All rights reserved.