1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 /* grapefruit1.sas */
75 title "Oneway ANOVA with repeated measures";
76 title2 'Grapefruit data (Applied linear statistical models, 5th ed., Prob 27.6)';
77
78 data grape1;
79 infile '/home/u1407221/441s24/data/grapefruit1.data.txt' firstobs=2;
80 input store sales1-sales3;
81 label sales1 = 'Sales at Price 1'
82 sales2 = 'Sales at Price 2'
83 sales3 = 'Sales at Price 3';
84 /* Pairwise differences */
85 d12 = sales1-sales2; d13 = sales1-sales3; d23=sales2-sales3;
86
NOTE: The infile '/home/u1407221/441s24/data/grapefruit1.data.txt' is:
Filename=/home/u1407221/441s24/data/grapefruit1.data.txt,
Owner Name=u1407221,Group Name=oda,
Access Permission=-rw-r--r--,
Last Modified=24Mar2024:18:49:46,
File Size (bytes)=522
NOTE: 8 records were read from the infile '/home/u1407221/441s24/data/grapefruit1.data.txt'.
The minimum record length was 56.
The maximum record length was 56.
NOTE: The data set WORK.GRAPE1 has 8 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 762.09k
OS Memory 27560.00k
Timestamp 03/24/2024 11:13:01 PM
Step Count 66 Switch Count 2
Page Faults 0
Page Reclaims 159
Page Swaps 0
Voluntary Context Switches 22
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
87 proc means n mean stddev maxdec=3;
88 var sales1-sales3;
89 run;
NOTE: There were 8 observations read from the data set WORK.GRAPE1.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 8645.21k
OS Memory 34492.00k
Timestamp 03/24/2024 11:13:01 PM
Step Count 67 Switch Count 1
Page Faults 0
Page Reclaims 1729
Page Swaps 0
Voluntary Context Switches 17
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 8
90
91 proc reg plots=none data=grape1;
92 title3 'Test H0: mu1=mu2=mu3 with proc reg';
93 model d12 d13 = ;
94 Price: mtest intercept=0;
95 run;
96
97 /* Linear combinations of response variables can be
98 specified within proc reg rather than in the data step.
99 Secify an equivalent null hypothesis, too. */
100
101 quit;
NOTE: PROCEDURE REG used (Total process time):
real time 0.07 seconds
user cpu time 0.07 seconds
system cpu time 0.00 seconds
memory 2911.40k
OS Memory 31424.00k
Timestamp 03/24/2024 11:13:01 PM
Step Count 68 Switch Count 2
Page Faults 0
Page Reclaims 396
Page Swaps 0
Voluntary Context Switches 22
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 72
101 ! /* For some reason, this is needed to make ods select work. */
102 ods select MultStat;
103 proc reg plots=none data=grape1;
104 title3 'Specifying linear combinations within proc reg';
105 model sales1 sales2 sales3 = ;
106 Price: mtest intercept=0, sales1-sales2,
107 sales2-sales3;
108 run;
109
NOTE: PROCEDURE REG used (Total process time):
real time 0.02 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 2471.21k
OS Memory 31936.00k
Timestamp 03/24/2024 11:13:01 PM
Step Count 69 Switch Count 2
Page Faults 0
Page Reclaims 302
Page Swaps 0
Voluntary Context Switches 21
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 56
110 proc glm data=grape1;
111 title3 'Test H0: mu1=mu2=mu3 with proc glm';
112 model sales1-sales3 = ;
113 repeated price / short summary mean;
114 run;
115 /* Could have done ods select MultStat -- no need for a quit this time. */
116
117 /* Note the Greenhouse-Geisser and Huynh-Feldt corrections for departures from
118 "sphericity." Sphericity means equal variances of the differences. */
119
120
NOTE: PROCEDURE GLM used (Total process time):
real time 0.16 seconds
user cpu time 0.16 seconds
system cpu time 0.01 seconds
memory 2157.31k
OS Memory 31416.00k
Timestamp 03/24/2024 11:13:01 PM
Step Count 70 Switch Count 3
Page Faults 0
Page Reclaims 238
Page Swaps 0
Voluntary Context Switches 20
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 384
121 proc means mean t probt maxdec=3 data=grape1;
122 title3 'Pairwise matched t-tests';
123 var d12 d13 d23;
124 run;
NOTE: There were 8 observations read from the data set WORK.GRAPE1.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.02 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 6571.31k
OS Memory 36284.00k
Timestamp 03/24/2024 11:13:01 PM
Step Count 71 Switch Count 2
Page Faults 0
Page Reclaims 1471
Page Swaps 0
Voluntary Context Switches 26
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
125 quit;
126
127
128 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
140