RM ANOVA not completely reproducible by split-plot ANOVA

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

RM ANOVA not completely reproducible by split-plot ANOVA

Kirill Orlov
Please clarify me the following theoretical issue which I miss or forgot.
I always thought that a repeated-measures ANOVA is basically a usual ANOVA with nested random factor "subject", the design which is also called "split-plot".
And so one can always replace Repeated-measures GLM procedure with Univariate GLM procedure performed on the "long" (restruscured) data.

However, I've found that when there is more than one between-group factors, the results of the two procedures are the same only for repeated-measures effects and all interactions involving those, and *not the same* for the between-group effects (except for their highest interaction).

data list list /subject� f1� f2 (3f5) rm1 rm2 rm3 (3f5.2).
begin data
� � � � 1� � � � � 1� � � � 2� 3.76� 2.74� 2.17
� � � � 2� � � � � 2� � � � 1� 4.08� 2.38� 2.65
� � � � 3� � � � � 2� � � � 2� 1.84� 3.52� 3.13
� � � � 4� � � � � 1� � � � 1� 2.75� 2.01� 1.55
� � � � 5� � � � � 2� � � � 1� 3.02� 1.00� 1.86
� � � � 6� � � � � 3� � � � 2� 3.69� 3.47� 2.98
� � � � 7� � � � � 2� � � � 1� 3.70� 4.37� 3.60
� � � � 8� � � � � 2� � � � 1� 3.98� 1.58� 2.53
� � � � 9� � � � � 2� � � � 3� 2.59� 2.61� 3.78
� � � 10� � � � � 2� � � � 1� 2.41� 4.43� 2.85
� � � 11� � � � � 1� � � � 1� 2.39� 3.22� 3.76
� � � 12� � � � � 1� � � � 2� 2.61� 3.80� 3.35
� � � 13� � � � � 3� � � � 2� 2.96� 4.16� 4.19
� � � 14� � � � � 2� � � � 1� 3.41� 3.60� 5.00
� � � 15� � � � � 1� � � � 2� 3.21� 1.30� 2.97
� � � 16� � � � � 3� � � � 2� 4.02� 2.37� 2.04
� � � 17� � � � � 3� � � � 1� 3.03� 3.02� 2.31
� � � 18� � � � � 3� � � � 2� 2.99� 3.21� 3.32
� � � 19� � � � � 2� � � � 2� 3.61� 3.31� 1.00
� � � 20� � � � � 3� � � � 2� 3.11� 3.03� 3.65
end data.
list.

*Run Repeated-measures ANOVA with between-subject factors.
GLM rm1 rm2 rm3 BY f1 f2
� /WSFACTOR= rm 3
� /WSDESIGN= rm
� /DESIGN= f1 f2 f1*f2.

*Restructure the data from "wide" to "long".
VARSTOCASES
� /MAKE y FROM rm1 rm2 rm3
� /INDEX= rm(3)
� /KEEP= subject f1 f2
� /NULL= KEEP.
*And run "split-plot" ANOVA (y as dependent, subject as nested random factor).
GLM y BY rm f1 f2 subject
� /RANDOM= subject
� /DESIGN= subject(f1*f2)
� � � � � � � � � � rm rm*f1 rm*f2 rm*f1*f2
� � � � � � � � � � f1 f2 f1*f2.

The results of the split-plot run are NOT the same as of RM-ANOVA for the between-subject effects f1 and f2 (except for their highest interaction, here f1*f2).
Why so? Either I miss something theoretically or do a wrong syntax.

Reply | Threaded
Open this post in threaded view
|

Re: RM ANOVA not completely reproducible by split-plot ANOVA

Bruce Weaver
Administrator
Hi Kirill.  I don't have SPSS on this computer, so can't try your example right now.  But I think one issue is that when you restructure the file from wide to long, you need to explicitly specify all of the error terms except for the last (most complicated) one to duplicate the results you get with a wide file.  Here's an example from one of my syntax files that illustrates what I'm talking about.

* ----------------------------- .
* ERROR TERMS MUST BE SPECIFIED .
* ----------------------------- .

* Using the LONG file format and UNIANOVA is more flexible than
* GLM REPEATED MEASURES, but that flexibility comes at a price.
* The price is that you have to specifiy ALL of the error terms to
* be included in the model--actually, all but the last error term,
* which will be the residual.

* If you do not specify all of the error terms (except the last),
* SPSS will use a pooled error term, which is most likely not
* what you want to do.

* For example, the following syntax is for a mixed-design ANOVA
* with A as a between-Ss factor, and B and C within-Ss.  Each
* subject had 6 rows of data, one for each of the 6 B*C combinations.
* The dependent variable was Y.

UNIANOVA
  y  BY subj a b c
  /RANDOM = subj
  /METHOD = SSTYPE(3)
  /INTERCEPT = INCLUDE
  /CRITERIA = ALPHA(.05)
  /print = etasq
  /plot = resid
  /DESIGN = a subj(a)
                b b*a b*subj(a)
                c c*a c*subj(a)
                b*c b*c*a .

* The notation "subj(a)" means "subjects nested within A".
* The final error term, which I've omitted is: b*c*subj(a) .
* This will show up as the residual, and will be used appropriately.

HTH.


Kirill Orlov wrote
Please clarify me the following theoretical issue which I miss or forgot.
I always thought that a repeated-measures ANOVA is basically a usual
ANOVA with nested random factor "subject", the design which is also
called "split-plot".
And so one can always replace Repeated-measures GLM procedure with
Univariate GLM procedure performed on the "long" (restruscured) data.

However, I've found that when there is more than one between-group
factors, the results of the two procedures are the same only for
repeated-measures effects and all interactions involving those, and *not
the same* for the between-group effects (except for their highest
interaction).

data list list /subject  f1  f2 (3f5) rm1 rm2 rm3 (3f5.2).
begin data
      1      1     2  3.76  2.74  2.17
      2      2     1  4.08  2.38  2.65
      3      2     2  1.84  3.52  3.13
      4      1     1  2.75  2.01  1.55
      5      2     1  3.02  1.00  1.86
      6      3     2  3.69  3.47  2.98
      7      2     1  3.70  4.37  3.60
      8      2     1  3.98  1.58  2.53
      9      2     3  2.59  2.61  3.78
     10      2     1  2.41  4.43  2.85
     11      1     1  2.39  3.22  3.76
     12      1     2  2.61  3.80  3.35
     13      3     2  2.96  4.16  4.19
     14      2     1  3.41  3.60  5.00
     15      1     2  3.21  1.30  2.97
     16      3     2  4.02  2.37  2.04
     17      3     1  3.03  3.02  2.31
     18      3     2  2.99  3.21  3.32
     19      2     2  3.61  3.31  1.00
     20      3     2  3.11  3.03  3.65
end data.
list.

*Run Repeated-measures ANOVA with between-subject factors.
GLM rm1 rm2 rm3 BY f1 f2
   /WSFACTOR= rm 3
   /WSDESIGN= rm
   /DESIGN= f1 f2 f1*f2.

*Restructure the data from "wide" to "long".
VARSTOCASES
   /MAKE y FROM rm1 rm2 rm3
   /INDEX= rm(3)
   /KEEP= subject f1 f2
   /NULL= KEEP.
*And run "split-plot" ANOVA (y as dependent, subject as nested random
factor).
GLM y BY rm f1 f2 subject
   /RANDOM= subject
   /DESIGN= subject(f1*f2)
            rm rm*f1 rm*f2 rm*f1*f2
            f1 f2 f1*f2.

The results of the split-plot run are NOT the same as of RM-ANOVA for
the between-subject effects f1 and f2 (except for their highest
interaction, here f1*f2).
Why so? Either I miss something theoretically or do a wrong syntax.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: RM ANOVA not completely reproducible by split-plot ANOVA

Bruce Weaver
Administrator
Sorry Kirill, now that I look at your example more carefully, I see that you did in fact include all the terms except for the highest order error term.  So that's not the problem.  

I bet it has to do with the fact that your example has empty cells.  Here's the f1 by f2 crosstabulation after reading in your original data set:

         f2=1  f2=2  f2=3
f1=1    2   3       0
f1=2    6   2       1
f1=3    1      5       0

HTH.


Bruce Weaver wrote
Hi Kirill.  I don't have SPSS on this computer, so can't try your example right now.  But I think one issue is that when you restructure the file from wide to long, you need to explicitly specify all of the error terms except for the last (most complicated) one to duplicate the results you get with a wide file.  Here's an example from one of my syntax files that illustrates what I'm talking about.

* ----------------------------- .
* ERROR TERMS MUST BE SPECIFIED .
* ----------------------------- .

* Using the LONG file format and UNIANOVA is more flexible than
* GLM REPEATED MEASURES, but that flexibility comes at a price.
* The price is that you have to specifiy ALL of the error terms to
* be included in the model--actually, all but the last error term,
* which will be the residual.

* If you do not specify all of the error terms (except the last),
* SPSS will use a pooled error term, which is most likely not
* what you want to do.

* For example, the following syntax is for a mixed-design ANOVA
* with A as a between-Ss factor, and B and C within-Ss.  Each
* subject had 6 rows of data, one for each of the 6 B*C combinations.
* The dependent variable was Y.

UNIANOVA
  y  BY subj a b c
  /RANDOM = subj
  /METHOD = SSTYPE(3)
  /INTERCEPT = INCLUDE
  /CRITERIA = ALPHA(.05)
  /print = etasq
  /plot = resid
  /DESIGN = a subj(a)
                b b*a b*subj(a)
                c c*a c*subj(a)
                b*c b*c*a .

* The notation "subj(a)" means "subjects nested within A".
* The final error term, which I've omitted is: b*c*subj(a) .
* This will show up as the residual, and will be used appropriately.

HTH.


Kirill Orlov wrote
Please clarify me the following theoretical issue which I miss or forgot.
I always thought that a repeated-measures ANOVA is basically a usual
ANOVA with nested random factor "subject", the design which is also
called "split-plot".
And so one can always replace Repeated-measures GLM procedure with
Univariate GLM procedure performed on the "long" (restruscured) data.

However, I've found that when there is more than one between-group
factors, the results of the two procedures are the same only for
repeated-measures effects and all interactions involving those, and *not
the same* for the between-group effects (except for their highest
interaction).

data list list /subject  f1  f2 (3f5) rm1 rm2 rm3 (3f5.2).
begin data
      1      1     2  3.76  2.74  2.17
      2      2     1  4.08  2.38  2.65
      3      2     2  1.84  3.52  3.13
      4      1     1  2.75  2.01  1.55
      5      2     1  3.02  1.00  1.86
      6      3     2  3.69  3.47  2.98
      7      2     1  3.70  4.37  3.60
      8      2     1  3.98  1.58  2.53
      9      2     3  2.59  2.61  3.78
     10      2     1  2.41  4.43  2.85
     11      1     1  2.39  3.22  3.76
     12      1     2  2.61  3.80  3.35
     13      3     2  2.96  4.16  4.19
     14      2     1  3.41  3.60  5.00
     15      1     2  3.21  1.30  2.97
     16      3     2  4.02  2.37  2.04
     17      3     1  3.03  3.02  2.31
     18      3     2  2.99  3.21  3.32
     19      2     2  3.61  3.31  1.00
     20      3     2  3.11  3.03  3.65
end data.
list.

*Run Repeated-measures ANOVA with between-subject factors.
GLM rm1 rm2 rm3 BY f1 f2
   /WSFACTOR= rm 3
   /WSDESIGN= rm
   /DESIGN= f1 f2 f1*f2.

*Restructure the data from "wide" to "long".
VARSTOCASES
   /MAKE y FROM rm1 rm2 rm3
   /INDEX= rm(3)
   /KEEP= subject f1 f2
   /NULL= KEEP.
*And run "split-plot" ANOVA (y as dependent, subject as nested random
factor).
GLM y BY rm f1 f2 subject
   /RANDOM= subject
   /DESIGN= subject(f1*f2)
            rm rm*f1 rm*f2 rm*f1*f2
            f1 f2 f1*f2.

The results of the split-plot run are NOT the same as of RM-ANOVA for
the between-subject effects f1 and f2 (except for their highest
interaction, here f1*f2).
Why so? Either I miss something theoretically or do a wrong syntax.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: RM ANOVA not completely reproducible by split-plot ANOVA

Kirill Orlov
Bruce,
I'm still confused. Adding cases to fill in the empty cells in the design didn't help. (And doubt it can change anything because, as far as I remember, type III SS check the same hypothethis in balanced and unbalanced designs.) So, if you run the following updated data you'll still find that f1 and f2 main effects are *different* in the RM-style analysis and the Mixed (split-plot)-style analysis. Any more ideas?

data list list /subject  f1  f2 (3f5) rm1 rm2 rm3 (3f5.2).
begin data
      1      1     2  3.76  2.74  2.17
      2      2     1  4.08  2.38  2.65
      3      2     2  1.84  3.52  3.13
      4      1     1  2.75  2.01  1.55
      5      2     1  3.02  1.00  1.86
      6      3     2  3.69  3.47  2.98
      7      2     1  3.70  4.37  3.60
      8      2     1  3.98  1.58  2.53
      9      2     3  2.59  2.61  3.78
     10      2     1  2.41  4.43  2.85
     11      1     1  2.39  3.22  3.76
     12      1     2  2.61  3.80  3.35
     13      3     2  2.96  4.16  4.19
     14      2     1  3.41  3.60  5.00
     15      1     2  3.21  1.30  2.97
     16      3     2  4.02  2.37  2.04
     17      3     1  3.03  3.02  2.31
     18      3     2  2.99  3.21  3.32
     19      2     2  3.61  3.31  1.00
     20      3     2  3.11  3.03  3.65
     21      1     3  3.26  1.02  2.17
     22      1     3  2.53  2.11  3.84
     23      3     3  4.10  1.59  2.42
end data.
list.

*Run Repeated-measures ANOVA with between-subject factors.
GLM rm1 rm2 rm3 BY f1 f2
   /WSFACTOR= rm 3
   /WSDESIGN= rm
   /DESIGN= f1 f2 f1*f2.

*Restructure the data from "wide" to "long".
VARSTOCASES
   /MAKE y FROM rm1 rm2 rm3
   /INDEX= rm(3)
   /KEEP= subject f1 f2
   /NULL= KEEP.
*And run "split-plot" ANOVA (y as dependent, subject as nested random
factor).
GLM y BY rm f1 f2 subject
   /RANDOM= subject
   /DESIGN= subject(f1*f2)
            rm rm*f1 rm*f2 rm*f1*f2
            f1 f2 f1*f2.


24.09.2013 18:27, Bruce Weaver пишет:
Sorry Kirill, now that I look at your example more carefully, I see that you
did in fact include all the terms except for the highest order error term.
So that's not the problem.

I bet it has to do with the fact that your example has empty cells.  Here's
the f1 by f2 crosstabulation after reading in your original data set:

         f2=1  f2=2  f2=3
f1=1    2          3       0
f1=2    6          2       1
f1=3    1      5       0

HTH.



Reply | Threaded
Open this post in threaded view
|

Re: RM ANOVA not completely reproducible by split-plot ANOVA

Ryan
Kirill,

I did not read your original post, but it looks like you have partitioned the variance correctly for an ANOVA with two between-Ss variables and one within-Ss variable. Why GLM is not providing the correct numerator SS for the main effects f1 and f2, I cannot say without further investigation.

If you have data which are missing at random and the data are structured vertically, you might consider employing a linear mixed model via the MIXED procedure:

MIXED y BY rm f1 f2
  /FIXED=rm f1 f2 rm*f1 rm*f2 f1*f2 rm*f1*f2 | SSTYPE(3)
  /METHOD=REML
  /RANDOM=INTERCEPT | SUBJECT(subject).

With a fully balanced design (without any missing data), the MIXED syntax above should produce F-statistics and p-values in the Type III Tests of Fixed Effects Table that are identical to those produced by the GLM syntax you provided previously for the wide file:

GLM rm1 rm2 rm3 BY f1 f2
   /WSFACTOR= rm 3
   /WSDESIGN= rm
   /DESIGN= f1 f2 f1*f2.

Ryan

On Sat, Sep 28, 2013 at 12:16 PM, Kirill Orlov <[hidden email]> wrote:
Bruce,
I'm still confused. Adding cases to fill in the empty cells in the design didn't help. (And doubt it can change anything because, as far as I remember, type III SS check the same hypothethis in balanced and unbalanced designs.) So, if you run the following updated data you'll still find that f1 and f2 main effects are *different* in the RM-style analysis and the Mixed (split-plot)-style analysis. Any more ideas?

data list list /subject  f1  f2 (3f5) rm1 rm2 rm3 (3f5.2).
begin data
      1      1     2  3.76  2.74  2.17
      2      2     1  4.08  2.38  2.65
      3      2     <a href="tel:2%C2%A0%201.84%C2%A0%203.52%C2%A0%203.13" value="+12184352313" target="_blank">2  1.84  3.52  3.13
      4      1     1  2.75  2.01  1.55
      5      2     1  3.02  1.00  1.86
      6      3     <a href="tel:2%C2%A0%203.69%C2%A0%203.47%C2%A0%202.98" value="+12369347298" target="_blank">2  3.69  3.47  2.98
      7      2     1  3.70  4.37  3.60
      8      2     1  3.98  1.58  2.53
      9      2     <a href="tel:3%C2%A0%202.59%C2%A0%202.61%C2%A0%203.78" value="+13259261378" target="_blank">3  2.59  2.61  3.78
     10      2     1  2.41  4.43  2.85
     11      1     1  2.39  3.22  3.76
     12      1     2  2.61  3.80  3.35
     13      3     <a href="tel:2%C2%A0%202.96%C2%A0%204.16%C2%A0%204.19" value="+12296416419" target="_blank">2  2.96  4.16  4.19
     14      2     1  3.41  3.60  5.00
     15      1     2  3.21  1.30  2.97
     16      3     <a href="tel:2%C2%A0%204.02%C2%A0%202.37%C2%A0%202.04" value="+12402237204" target="_blank">2  4.02  2.37  2.04
     17      3     1  3.03  3.02  2.31
     18      3     <a href="tel:2%C2%A0%202.99%C2%A0%203.21%C2%A0%203.32" value="+12299321332" target="_blank">2  2.99  3.21  3.32
     19      2     2  3.61  3.31  1.00
     20      3     2  3.11  3.03  3.65
     21      1     3  3.26  1.02  2.17
     22      1     <a href="tel:3%C2%A0%202.53%C2%A0%202.11%C2%A0%203.84" value="+13253211384" target="_blank">3  2.53  2.11  3.84
     23      3     3  4.10  1.59  2.42
end data.
list.

*Run Repeated-measures ANOVA with between-subject factors.
GLM rm1 rm2 rm3 BY f1 f2
   /WSFACTOR= rm 3
   /WSDESIGN= rm
   /DESIGN= f1 f2 f1*f2.

*Restructure the data from "wide" to "long".
VARSTOCASES
   /MAKE y FROM rm1 rm2 rm3
   /INDEX= rm(3)
   /KEEP= subject f1 f2
   /NULL= KEEP.
*And run "split-plot" ANOVA (y as dependent, subject as nested random
factor).
GLM y BY rm f1 f2 subject
   /RANDOM= subject
   /DESIGN= subject(f1*f2)
            rm rm*f1 rm*f2 rm*f1*f2
            f1 f2 f1*f2.


<a href="tel:24.09.2013%2018" value="+12409201318" target="_blank">24.09.2013 18:27, Bruce Weaver пишет:
Sorry Kirill, now that I look at your example more carefully, I see that you
did in fact include all the terms except for the highest order error term.
So that's not the problem.

I bet it has to do with the fact that your example has empty cells.  Here's
the f1 by f2 crosstabulation after reading in your original data set:

         f2=1  f2=2  f2=3
f1=1    2          3       0
f1=2    6          2       1
f1=3    1      5       0

HTH.




Reply | Threaded
Open this post in threaded view
|

Re: RM ANOVA not completely reproducible by split-plot ANOVA

Kirill Orlov
That's indeed so, Ryan. But it doesn't answer my question. I'm still confused.

With my data, the following equivalent MIXED command syntaxes [long-format data]...

MIXED y BY rm f1 f2 respid
� /FIXED= rm rm*f1 rm*f2 rm*f1*f2 f1 f2 f1*f2 | SSTYPE(3)
� /METHOD= REML
� /RANDOM= INTERCEPT | SUBJECT(respid).
*or.
MIXED y BY rm f1 f2 respid
� /FIXED= rm rm*f1 rm*f2 rm*f1*f2 f1 f2 f1*f2 | SSTYPE(3)
� /METHOD= REML
� /RANDOM= respid.
*or.
MIXED y BY rm f1 f2 respid
� /FIXED= rm rm*f1 rm*f2 rm*f1*f2 f1 f2 f1*f2 | SSTYPE(3)
� /METHOD= REML
� /REPEATED= rm | SUBJECT(respid) COVTYPE(CS).

...produce results identical to the RM-ANOVA [wide-format data]:.

GLM rm1 rm2 rm3 BY f1 f2
� � /WSFACTOR= rm 3
� � /WSDESIGN= rm
� � /DESIGN= f1 f2 f1*f2.

However, my curiosity and the question was this: "Why do I can't get exactly the same results with Univariate GLM?" I can get them only when there is one between-group factor, but I have two - f1, f2. The command of that univariate (split-plot) ANOVA is [long-format data]:.

GLM y BY rm f1 f2 respid
� � /RANDOM= respid
� � /DESIGN= respid(f1*f2)
� � � � � � � � � � � rm rm*f1 rm*f2 rm*f1*f2
� � � � � � � � � � � f1 f2 f1*f2.

To try to understand it, I attempted to reproduce the results of this above univariate GLM by MIXED command. But I failed. So I don't know what syntax configuration in MIXED might correspond to it. Hence I can't answer my question. Maybe someone else can. Maybe nobody can.

Perhaps some hint for the clue is in the following words by Marija Norusis ("SPSS 15 Advanced Statistical Procedures Companion" book, Chapter Linear Miixed Models): "The GLM procedure in SPSS allows specification of random effects but estimates them as if they were fixed. The variance components estimates are calculated from expected mean squares, unlike the estimates calculated in the MIXED procedure, which are based on restricted maximum likelihood..."

I'm giving once more the data to run the above analyses:.

*Wide-format data.
data list list /respid� f1� f2 (3f5) rm1 rm2 rm3 (3f5.2).
begin data
� � � � � 1� � � � � 1� � � � 2� 3.76� 2.74� 2.17
� � � � � 2� � � � � 2� � � � 1� 4.08� 2.38� 2.65
� � � � � 3� � � � � 2� � � � 2� 1.84� 3.52� 3.13
� � � � � 4� � � � � 1� � � � 1� 2.75� 2.01� 1.55
� � � � � 5� � � � � 2� � � � 1� 3.02� 1.00� 1.86
� � � � � 6� � � � � 3� � � � 2� 3.69� 3.47� 2.98
� � � � � 7� � � � � 2� � � � 1� 3.70� 4.37� 3.60
� � � � � 8� � � � � 2� � � � 1� 3.98� 1.58� 2.53
� � � � � 9� � � � � 2� � � � 3� 2.59� 2.61� 3.78
� � � � 10� � � � � 2� � � � 1� 2.41� 4.43� 2.85
� � � � 11� � � � � 1� � � � 1� 2.39� 3.22� 3.76
� � � � 12� � � � � 1� � � � 2� 2.61� 3.80� 3.35
� � � � 13� � � � � 3� � � � 2� 2.96� 4.16� 4.19
� � � � 14� � � � � 2� � � � 1� 3.41� 3.60� 5.00
� � � � 15� � � � � 1� � � � 2� 3.21� 1.30� 2.97
� � � � 16� � � � � 3� � � � 2� 4.02� 2.37� 2.04
� � � � 17� � � � � 3� � � � 1� 3.03� 3.02� 2.31
� � � � 18� � � � � 3� � � � 2� 2.99� 3.21� 3.32
� � � � 19� � � � � 2� � � � 2� 3.61� 3.31� 1.00
� � � � 20� � � � � 3� � � � 2� 3.11� 3.03� 3.65
� � � � 21� � � � � 1� � � � 3� 3.26� 1.02� 2.17
� � � � 22� � � � � 1� � � � 3� 2.53� 2.11� 3.84
� � � � 23� � � � � 3� � � � 3� 4.10� 1.59� 2.42
end data.

*To make it long-format, run:.
VARSTOCASES
� � /MAKE y FROM rm1 rm2 rm3
� � /INDEX= rm(3)
� � /KEEP= respid f1 f2
� � /NULL= KEEP.



29.09.2013 8:25, Ryan Black пишет:
Kirill,

I did not read your original post, but it looks like you have partitioned the variance correctly for an ANOVA with two between-Ss variables and one within-Ss variable. Why GLM is not providing the correct numerator SS for the main effects f1 and f2, I cannot say without further investigation.

If you have data which are missing at random and the data are structured vertically, you might consider employing a linear mixed model via the MIXED procedure:

MIXED y BY rm f1 f2
� /FIXED=rm f1 f2 rm*f1 rm*f2 f1*f2 rm*f1*f2 | SSTYPE(3)
� /METHOD=REML
� /RANDOM=INTERCEPT | SUBJECT(subject).

With a fully balanced design (without any missing data), the MIXED syntax above should produce F-statistics and p-values in the Type III Tests of Fixed Effects Table that are identical to those produced by the GLM syntax you provided previously for the wide file:

GLM rm1 rm2 rm3 BY f1 f2
� � /WSFACTOR= rm 3
� � /WSDESIGN= rm
� � /DESIGN= f1 f2 f1*f2.