R 中使用 aov_ez 的混合模型方差分析(包:afex)

时间:2021-06-02 12:37:00

标签: r error-handling anova

我目前正在使用 afex 包中的 aov_ez 进行混合模型方差分析。该函数工作正常,我得到一个方差分析汇总表,但它给了我错误:

Univariate Type III Repeated-Measures ANOVA Assuming Sphericity

                    Sum Sq num Df Error SS den Df F value    Pr(>F)    
(Intercept)        3831173      1  4881918     15 11.7715  0.003714 ** 
group                89103      1  4881918     15  0.2738  0.608455    
session            2287006     20  4214873    300  8.1391 < 2.2e-16 ***
group:session       821941     20  4214873    300  2.9251 4.083e-05 ***
type                817263      1  1438818     15  8.5201  0.010580 *  
group:type             608      1  1438818     15  0.0063  0.937578    
session:type        822818     20  2296312    300  5.3748 1.177e-11 ***
group:session:type  263515     20  2296312    300  1.7213  0.029307 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Warning message:
In summary.Anova.mlm(object$Anova, multivariate = FALSE) :
  Singular error SSP matrix:
non-sphericity test and corrections not available

我使用的数据结构如下:

     id session     time         group type
0     1       1    0.000       Control  CS+
1     2       1    0.000       Control  CS+
2     3       1    0.000       Control  CS+
3     4       1    0.000       Control  CS+
4     5       1    0.000       Control  CS+
..   ..     ...      ...           ...  ...
205  13      21  202.875  Experimental  CS-
206  14      21    0.000  Experimental  CS-
207  15      21   75.250  Experimental  CS-
208  16      21    0.000  Experimental  CS-
209  17      21    0.000  Experimental  CS-

[714 rows x 5 columns]

我使用过的代码:

aov_ez("id", "time", data, between = c("group"), within = c("session", "type"), 
                 anova_table=list(correction = "GG", es = "pes"), print.formula=T, 
                 type=c("3"), check_contrasts=T,
                 return = c("afex_aov"))

导致此错误消息的原因是什么?我怎样才能得到我的球度测试结果和校正?我认为这与我有两个组(因子之间)和两种类型(因子内)导致 Df 为 1 的事实有关,但我不确定。

提前致谢!

佩尔

0 个答案:

没有答案