Skip to content
Prev 199685 / 398502 Next

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

Hi Mike,

I tried to run my data in SPSS and it works fine without any problems,
plug in my levels, plug in my covariate (since it is all within) and
get my Mauchly Tests.

I tried to rearrange the data so it looks like this

subj/treatment/day1/day2/day3

subject??? treatment??? day1??? day2??? day3
1??? 1??? 8??? 8??? 8
1??? 2??? 5??? 7??? 5
2??? 1??? 7??? 4??? 4
2??? 2??? 4??? 5??? 7
3??? 1??? 8??? 6??? 4
3??? 2??? 5??? 2??? 4
4??? 1??? 2??? 9??? 4
4??? 2??? 1??? 9??? 1
5??? 1??? 4??? 8??? 1
5??? 2??? 7??? 8??? 2
6??? 1??? 4??? 7??? 2
6??? 2??? 4??? 5??? 2


When I try mlmfit <- lm(Dataset~1), I get "invalid type (list) for
variable 'Dataset"

When I try

mod <- lm(cbind(day1, day2, day3) ~ Treatment, data=Dataset)

idata<- data.frame(factor(rep(c(Dataset$day1, Dataset$day2, Dataset$day3))),
ordered(Dataset$Treatment))

Anova(mod, idata=idata, idesign=~Dataset$Treatment)

I get: Terms in the intra-subject model matrix are not orthogonal.

When I try is.matrix(Dataset) - I get no.

My original mock Dataset (attached in txt) is below.  Maybe I am not
coding it right? I would hate to recode all my data for SPSS, since at
the end I would need to show that Sphericity was not violated.

Subj	Trtmt	Sessn	Response

1	N	1	5

1	D	1	6

1	N	2	4

1	D	2	7

2	N	1	8

2	D	1	9

2	N	2	2

2	D	2	1

3	N	1	4

3	D	1	5

3	N	2	6

3	D	2	2

4	N	1	5

4	D	1	6

4	N	2	4

4	D	2	7

5	N	1	8

5	D	1	9

5	N	2	2

5	D	2	1

6	N	1	4

6	D	1	5

6	N	2	6

6	D	2	2




Sincerely,

Sergios Charntikov (Sergey), MA

Behavioral Neuropharmacology Lab
Department of Psychology
University of Nebraska-Lincoln
Lincoln, NE 68588-0308 ?USA
On Mon, Nov 9, 2009 at 5:29 PM, Mike Lawrence <Mike.Lawrence at dal.ca> wrote:
-------------- next part --------------
Subj	Trtmt	Sessn	Response
1	N	1	5
1	D	1	6
1	N	2	4
1	D	2	7
2	N	1	8
2	D	1	9
2	N	2	2
2	D	2	1
3	N	1	4
3	D	1	5
3	N	2	6
3	D	2	2
4	N	1	5
4	D	1	6
4	N	2	4
4	D	2	7
5	N	1	8
5	D	1	9
5	N	2	2
5	D	2	1
6	N	1	4
6	D	1	5
6	N	2	6
6	D	2	2