/* Doubly Multivariate Design - Two Variables, Repeated Measures */ title 'Doubly Multivariate design - Plotting means'; data exam9; input trt $ reps PreY1 PostY1 FolY1 PreY2 PostY2 FolY2; label trt ='Treatment' reps ='Subject' PreY1='Pretest Y1' PostY1='Posttest Y1' FolY1='Follow up Y1' PreY2='Pretest Y2' PostY2='Posttest Y2' FolY2='Follow up Y2'; datalines; TreatA 1 3 13 9 0 0 9 TreatA 2 0 14 10 6 6 3 TreatA 3 4 6 17 8 2 6 TreatA 4 7 7 13 7 6 4 TreatA 5 3 12 11 6 12 6 TreatA 6 10 14 8 13 3 8 TreatB 1 9 11 17 8 11 27 TreatB 2 4 16 13 9 3 26 TreatB 3 8 10 9 12 0 18 TreatB 4 5 9 13 3 0 14 TreatB 5 0 15 11 3 0 25 TreatB 6 4 11 14 4 2 9 Control 1 10 12 15 4 3 7 Control 2 2 8 12 8 7 20 Control 3 4 9 10 2 0 10 Control 4 10 8 8 5 8 14 Control 5 11 11 11 1 0 11 Control 6 1 5 15 8 9 10 ; proc means data=exam9 noprint; class trt; var PreY1 PostY1 FolY1 PreY2 PostY2 FolY2; output out=means mean=; proc print; title2 Output dataset from proc means; run; data reshape; set exam9; drop PreY1 PostY1 FolY1 PreY2 PostY2 FolY2; label response='Response' time='Time' ; if trt ^= 'Control' then trt=substr(trt,6); measure = 'Y1'; time = '1: Pre '; response = PreY1 ; output; time = '2: Post '; response = PostY1; output; time = '3: FollowUp'; response = FolY1 ; output; measure = 'Y2'; time = '1: Pre '; response = PreY2 ; output; time = '2: Post '; response = PostY2; output; time = '3: FollowUp'; response = FolY2 ; output; *include goptions; title2; goptions htext=2; %gdispla(OFF); axis1 label=(a=90) order=(0 to 20 by 2); %meanplot(data=reshape, class=Time Trt Measure, response=response, vaxis=axis1, pmean=no); %gdispla(ON); goptions xpixels=800 ypixels=800; %panels(rows=1, cols=2); /* *-- Doing plots the long way; proc summary data=reshape nway; class trt time measure; var response; output out=means mean=response stderr=stderr; proc print; title2 'Output dataset from Proc MEANS/SUMMARY'; proc sort data=means; by measure; proc plot data=means; plot response * time = trt; by measure; title2; run; */