One-factor within-subjects ANOVA

The following example shows how to use the SPSS MIXED procedure to estimate a one-factor within-subjects ANOVA with missing values on the repeated measures variables.

The typical data setup for a within-subjects ANOVA has the repeated measures variables as separate columns (i.e., wide format).  For example, consider a design with five repeated measures variables (rm1 to rm5).  The data would look like this.

In order to use the SPSS mixed procedure to implement maximum likelihood estimation, the data must be stacked, such that the repeated measures variables appear in a single column and each case has multiple rows of data.  The stacked file would look like this.

The VARSTOCASES command (from the pull-downs, choose DATA then RESTRUCTURE) stacks the data file.  The syntax for the above example is as follows.


varstocases

   /make dv from rm1 rm2 rm3 rm4 rm5

   /index = wsfactor (5)

   /keep id

   /null = keep. 


Finally, the MIXED syntax for the analysis is as follows.  The EMMEANS subcommands give maximum likelihood mean estimates and significance tests for the main effects.


* the emmeans line gives maximum likelihood mean estimates and comparisons.

mixed dv by wsfactor

   /method = ml

   /print = testcov

   /emmeans = tables (wsfactor) compare(wsfactor)

   /fixed = wsfactor

   /repeated = wsfactor | subject(id) covtype(cs).


The previous analysis specifies a compound symmetric covariance structure that is consistent with a standard repeated measures ANOVA.  Changing the covariance structure from CS to UN implements an unstructured covariance matrix (less stringent assumptions, more estimated parameters).  The square root of the diagonal elements in the estimated covariance matrix are maximum likelihood standard deviations.

Questions or suggestions? Email Craig Enders