GLM Syntax - Example 2: Between-within (repeated measures) design
This example illustrates the specification for a 1-way between-group and 2-way within subject (repeated measures) design. You can run this example with the example data file Dials.sta. Note that brief descriptive comments are enclosed in curly brackets.
GLM;
{ Dependent variable list: }
DEPENDENT = TIM1_DL1 TIM1_DL2 TIM1_DL3
TIM2_DL1 TIM2_DL2 TIM2_DL3
TIM3_DL1 TIM3_DL2 TIM3_DL3;
{ Specification of grouping variable; note that
the text values (codes) are specified inside single quotation
marks; you can also specify numbers (e.g., 1 2), or not
specify any values, to use all that are found in variable NOISE
in the data file }
GROUPS = NOISE('MEANGFLL' 'WHITE');
{ There is only one between-group factor in the design, so only
the main effect will be specified as for the between group design }
DESIGN = NOISE;
{ Two within-subject (repeated) measures are specified, each has
three levels. As the program assigns dependent variables to the
combinations of levels for the repeated measures factor, the fastest
moving index is that of the last-specified repeated measures factor
(i.e., DIALS); thus, TIM1_DL1 has the data for the first level of both
factors TIME and DIALS, TIM1_DL2 for the first level for TIME and
the second for DIALS, ..., TIM2_DL1 for the second level for TIME,
and the first level for DIALS, and so on.}
REPEATED = TIME 3 DIALS 3;
{ The within-subject repeated measures design is the full factorial
design for the two factors. }
WDESIGN = TIME | DIALS;
For more examples, see GLM Syntax Examples.