1

I ran the following code (taken from here):

set.seed(123)
Njk   <- 10
P     <- 2
Q     <- 2
R     <- 3
DV_t1 <- rnorm(P*Q*Njk, -3, 2)
DV_t2 <- rnorm(P*Q*Njk,  1, 2)
DV_t3 <- rnorm(P*Q*Njk,  2, 2)
dfSPFpq.rL <- data.frame(id=factor(rep(1:(P*Q*Njk), times=R)),
                         IVbtw1=factor(rep(1:P, times=Q*R*Njk)),
                         IVbtw2=factor(rep(rep(1:Q, each=P*Njk), times=R)),
                         IVwth=factor(rep(1:R, each=P*Q*Njk)),
                         DV=c(DV_t1, DV_t2, DV_t3))
aovSPFpq.r <- aov(DV ~ IVbtw1*IVbtw2*IVwth + Error(id/IVwth), data=dfSPFpq.rL)
summary(aovSPFpq.r)

Now I want to run ScheffeTest:

I tried:

 library(DescTools)
 ScheffeTest.aov(aovSPFpq.r)

Error in pf(psi^2/(MSE * sscoeff * dfgrp), df1 = dfgrp, df2 = dferr, lower.tail = FALSE) :
Non-numeric argument to mathematical function
ScheffeTest(aovSPFpq.r) Error in model.frame.default(formula = x ~ g, drop.unused.levels = TRUE) :
invalid type (list) for variable 'x'

What is the correct way to run ScheffeTest with aov object?

zx8754
  • 52,746
  • 12
  • 114
  • 209
mamatv
  • 3,581
  • 4
  • 19
  • 25
  • Which package are you using? –  Oct 27 '15 at 07:15
  • Hi Pascal, I am using "DescTools" for ScheffeTest – mamatv Oct 27 '15 at 07:54
  • Not a solution, but might lead to one: when you remove the Error(...) from your model, the ScheffeTest runs. – Heroka Oct 27 '15 at 10:52
  • Hi @Heroka, thank you, but without Error term, how can I defined fixed effect of IVwth variable? – mamatv Oct 27 '15 at 11:50
  • `DescTools::ScheffeTest()` does not support objects of class `aovlist` that are the result from a call to `aov()` when there is an `Error()` term. Have a look at [this answer](http://stats.stackexchange.com/a/145936/1909) if you are interested in post-hoc tests in repeated-measures designs. – caracal Apr 22 '16 at 08:32

0 Answers0