-1

警告:包含自学的 R 新手。

Summary(aov.sample)创建一个方差分析结果表,使得

Error: particip
      Df Sum Sq Mean Sq F value Pr(>F)
Residuals 11  16.49   1.499               

Error: particip:device
          Df Sum Sq Mean Sq F value Pr(>F)  
device     1  14.22  14.222    3.76 0.0786 .
Residuals 11  41.61   3.783                 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: particip:width
          Df Sum Sq Mean Sq F value   Pr(>F)    
width      1 177.35  177.35   63.64 6.71e-06 ***
Residuals 11  30.65    2.79                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: particip:length
          Df Sum Sq Mean Sq F value   Pr(>F)    
length     1 183.68  183.68   115.5 3.57e-07 ***
Residuals 11  17.49    1.59                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: particip:device:width
             Df Sum Sq Mean Sq F value Pr(>F)
device:width  1   0.50   0.500    0.14  0.715
Residuals    11  39.17   3.561               

Error: particip:device:length
              Df Sum Sq Mean Sq F value Pr(>F)
device:length  1  1.389   1.389   0.661  0.433
Residuals     11 23.111   2.101               

Error: particip:width:length
             Df Sum Sq Mean Sq F value   Pr(>F)    
width:length  1 276.13  276.13   120.5 2.89e-07 ***
Residuals    11  25.21    2.29                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: particip:device:width:length
                    Df Sum Sq Mean Sq F value Pr(>F)
device:width:length  1  2.722   2.722   1.085   0.32
Residuals           11 27.611   2.510               

Error: Within
                           Df Sum Sq Mean Sq F value Pr(>F)
group                       2    7.1   3.566   1.327  0.268
group:device                2    0.6   0.316   0.118  0.889
group:width                 2    0.1   0.045   0.017  0.983
group:length                2    6.0   3.024   1.125  0.327
group:device:width          2    1.6   0.823   0.306  0.737
group:device:length         2    1.7   0.858   0.319  0.727
group:width:length          2    3.1   1.531   0.570  0.567
group:device:width:length   2    8.0   4.003   1.490  0.228
Residuals                 176  473.0   2.688

其中typeof() = listclass() = summary.aovlist。我试图用来delim.table帮助我以 CSV 友好且可读的格式输出此表,但我得到的错误说cannot coerce class ""summary.aovlist"" to a data.frame,尽管 delim.table 文档说它会列出一个列表。我假设 aovlist 子类有一些特别之处,这是一个问题,但我不确定如何找出什么或如何解决它。我在这里做错了什么,如何以可读的方式将此表输出到 CSV?

4

1 回答 1

-1

问题是没有规律性。这些并不是真正的“表格”,而是文本和矩阵的拼凑。要使这个逗号分隔,您需要遍历并用逗号替换文本输出中的所有空格,导致我认为一团糟。此外,您要求使用您尚未确定其来源的功能来完成此操作:

> ?delim.table
No documentation for ‘delim.table’ in specified packages and libraries:
you could try ‘??delim.table’

'aovlist' 的一个实例可能就是……一个列表。您可以遍历列表并输出适合作为常规对象输出的节点。但是要向您展示在这种情况下如何做到这一点,需要大量的猜测。

于 2013-07-09T22:27:44.057 回答