Published on :
Statistical CREATION_INTERNE

Example 9 for PROC GLM: Doubly Multivariate Repeated Measures Analysis

This code is also available in: Deutsch Español Français
Awaiting validation
This script illustrates the use of the GLM procedure to analyze data where subjects are measured repeatedly (time factor) on multiple response variables. It demonstrates the use of the REPEATED statement to define within-subject factors (Response and Time) and the alternative with the MANOVA statement to specifically test the main effects of time via contrasts.
Data Analysis

Type : CREATION_INTERNE


Data is created via a DATA step 'Trial' using datalines included in the script.

1 Code Block
DATA STEP Data
Explanation :
Creation of the 'Trial' dataset containing treatments and repeated measurements (Pre, Post, Follow) for two response variables (Y1, Y2).
Copied!
1DATA Trial;
2 INPUT Treatment $ Repetition PreY1 PostY1 FollowY1
3 PreY2 PostY2 FollowY2;
4 DATALINES;
5A 1 3 13 9 0 0 9
6A 2 0 14 10 6 6 3
7A 3 4 6 17 8 2 6
8A 4 7 7 13 7 6 4
9A 5 3 12 11 6 12 6
10A 6 10 14 8 13 3 8
11B 1 9 11 17 8 11 27
12B 2 4 16 13 9 3 26
13B 3 8 10 9 12 0 18
14B 4 5 9 13 3 0 14
15B 5 0 15 11 3 0 25
16B 6 4 11 14 4 2 9
17Control 1 10 12 15 4 3 7
18Control 2 2 8 12 8 7 20
19Control 3 4 9 10 2 0 10
20Control 4 10 8 8 5 8 14
21Control 5 11 11 11 1 0 11
22Control 6 1 5 15 8 9 10
23;
2 Code Block
PROC GLM
Explanation :
Execution of PROC GLM with the REPEATED statement to analyze within-subject factors. 'Response' has 2 levels (Y1, Y2) and 'Time' has 3 levels (Pre, Post, Follow). The 'nouni' option suppresses individual univariate analyses.
Copied!
1PROC GLM DATA=Trial;
2 class Treatment;
3 model PreY1 PostY1 FollowY1
4 PreY2 PostY2 FollowY2 = Treatment / nouni;
5 repeated Response 2 identity, Time 3;
6RUN;
3 Code Block
PROC GLM
Explanation :
Use of the MANOVA statement to test the main effect of time globally (Intercept in the transformed M space). M transformations calculate differences between times for each response variable.
Copied!
1PROC GLM DATA=Trial;
2 class Treatment;
3 model PreY1 PostY1 FollowY1
4 PreY2 PostY2 FollowY2 = Treatment / nouni;
5 manova h=intercept m=prey1 - posty1,
6 prey1 - followy1,
7 prey2 - posty2,
8 prey2 - followy2 / summary;
9RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : S A S S A M P L E L I B R A R Y