Skip to content
Prev 199649 / 398503 Next

Getting Sphericity Tests for Within Subject Repeated Measure Anova (using "car" package) (Adjusted Dataset)

Based on what you suggested I did the following:


1. Dataset$Sessn <- as.factor(Dataset$Sessn)
2. mod <- lm(cbind(Sessn=="1", Sessn=="2") ~ Trtmt, data=Dataset)
3. idata <- data.frame(Sessn=factor(1:2))
4. Anova(mod, idata=idata, idesign=~Sessn))
ERROR:  The error SSP matrix is apparently of deficient rank = 0 < 1

I have noticed that my DV (Response) is not in play in the coding above.
Then I have modified it to:

mod2 <- lm(*Response*~(cbind(Sessn=="1", Sessn=="2")) * Trtmt, data=Dataset)
idata2 <- data.frame(Sessn=factor(1:2))
Anova(mod, idata=idata2, idesign=~Sessn)
ERROR: The error SSP matrix is apparently of deficient rank = 0 < 1

Then I have modified it to:

mod2 <- lm(Response~(cbind(Sessn=="1", Sessn=="2")) * Trtmt, data=Dataset)
idata2 <- data.frame(Sessn=factor(1:2))
Anova(mod, idata=idata2, idesign=~*(cbind(Sessn=="1", Sessn=="2")) * Trtmt*)
ERROR:  object 'Trtmt' not found

Then I have modified it to:

mod2 <- lm(Response~(cbind(Sessn=="1", Sessn=="2")) * Trtmt, data=Dataset)
idata2 <- data.frame(Sessn=factor(1:2))
Anova(mod, idata=idata2, idesign=~(cbind(Sessn=="1", Sessn=="2")) * *
Dataset$Trtmt*)
ERROR:  variable lengths differ (found for 'Dataset$Trtmt') [THIS IS THE
ERROR THAT I HAVE BEEN
GETTING WITH MY ACTUAL DATASET FOLLOWING "CAR" PACKAGE RECOMMENDATIONS)

Any idea what am I doing wrong?  I have attached my mock data for
convenience in csv.


Sincerely,

Sergios Charntikov (Sergey), MA

Behavioral Neuropharmacology Lab
Department of Psychology
University of Nebraska-Lincoln
Lincoln, NE 68588-0308  USA

sergioschr at gmail.com
www.unl.edu/psychoneuropharm/
On Mon, Nov 9, 2009 at 12:33 PM, John Fox <jfox at mcmaster.ca> wrote: