1

我尝试使用TukeyHSD(my_anova$aov)但它给出了一个错误:

Error in UseMethod("TukeyHSD") :
no applicable method for 'TukeyHSD' applied to an object of class "c('aovlist', 'listof')"

谷歌表示没有办法使用“aovlist”进行临时性发布。但也许你对 ezANOVA 输出的事后有任何想法。

例子:

require(ez)
data(ANT)
rt_anova = ezANOVA(data = ANT[ANT$error==0,], dv = rt, wid = subnum, within = cue,return_aov = TRUE)

尝试使用 multcomp:

require(multcomp)
glht(my_anova$aov, linfct = mcp(cue = "Tukey"))

Error in model.matrix.aovlist(model) : 
  ‘glht’ does not support objects of class ‘aovlist’
Error in factor_contrasts(model) : 
  no ‘model.matrix’ method for ‘model’ found!

尝试使用lme

require(nlme)
lme_velocity = lme(rt ~ cue, data=ANT[ANT$error==0,], random = ~1|subnum)

Error in .Call("La_chol", as.matrix(x), PACKAGE = "base") : 
  Incorrect number of arguments (1), expecting 2 for 'La_chol'



> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Russian_Russia.1251  LC_CTYPE=Russian_Russia.1251    LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C                    LC_TIME=Russian_Russia.1251    

attached base packages:
[1] splines   stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] nlme_3.1-108     multcomp_1.2-15  survival_2.37-2  mvtnorm_0.9-9994 ez_4.1-1         stringr_0.6.2    scales_0.2.3     reshape2_1.2.2   plyr_1.8         memoise_0.1     
[11] mgcv_1.7-22      lme4_0.999999-0  Matrix_1.0-10    lattice_0.20-13  ggplot2_0.9.3    car_2.0-15       nnet_7.3-5       MASS_7.3-23     

loaded via a namespace (and not attached):
 [1] colorspace_1.2-1   dichromat_2.0-0    digest_0.6.2       grid_2.15.0        gtable_0.1.2       labeling_0.1       munsell_0.4        proto_0.3-10       RColorBrewer_1.0-5
[10] stats4_2.15.0      tools_2.15.0
4

2 回答 2

2

这不是 ezANOVA 输出,而是重复测量 ANOVA。'aovlist' 类通常用于此目的。TukeyHSD 用于独立设计。在此处查看此问题和相关链接。

于 2013-02-05T12:58:38.800 回答
1

您没有提供任何可重现的代码,但我的猜测是您需要使用包multcomp

require(multcomp)
glht(my_anova$aov, linfct = mcp(cue= "Tukey"))

(不适用于重复措施aov,请参阅@John 的回答为什么)

===更新===

您的代码对我有用(R 2.15.2,nlme 3.1-105,multcomp 1.2-15):

> data(ANT)
> lme_velocity = lme(rt ~ cue, data=ANT[ANT$error==0,], random = ~1|subnum)
> glht(lme_velocity, linfct = mcp(cue= "Tukey"))

     General Linear Hypotheses

Multiple Comparisons of Means: Tukey Contrasts


Linear Hypotheses:
                      Estimate
Center - None == 0     -41.872
Double - None == 0     -47.897
Spatial - None == 0    -86.040
Double - Center == 0    -6.026
Spatial - Center == 0  -44.169
Spatial - Double == 0  -38.143
于 2013-02-05T12:44:04.417 回答