1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;7273 /* grapefruit2.sas */74 title "Oneway ANOVA with repeated measures: Covariance Structure Approach";75 title2 'Grapefruit data (Applied linear statistical models, 5th ed., Prob 27.6)';7677 data grape1;78 infile '/home/u1407221/441s24/data/grapefruit1.data.txt' firstobs=2;79 input store sales1-sales3;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)=522NOTE: 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 4 variables.NOTE: DATA statement used (Total process time):real time 0.00 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 772.56kOS Memory 28328.00kTimestamp 04/01/2024 11:52:35 PMStep Count 136 Switch Count 2Page Faults 0Page Reclaims 147Page Swaps 0Voluntary Context Switches 18Involuntary Context Switches 0Block Input Operations 0Block Output Operations 26480 proc print data=grape1;81 run;NOTE: There were 8 observations read from the data set WORK.GRAPE1.NOTE: PROCEDURE PRINT used (Total process time):real time 0.02 secondsuser cpu time 0.02 secondssystem cpu time 0.00 secondsmemory 2437.84kOS Memory 28840.00kTimestamp 04/01/2024 11:52:35 PMStep Count 137 Switch Count 0Page Faults 0Page Reclaims 162Page Swaps 0Voluntary Context Switches 0Involuntary Context Switches 0Block Input Operations 0Block Output Operations 88283 data grape2; /* This data set will have 3n cases. */84 set grape1;85 price = 1; sales = sales1; output; /* Output creates a new case. */86 price = 2; sales = sales2; output;87 price = 3; sales = sales3; output;88 /* Would keep store price sales; */89NOTE: There were 8 observations read from the data set WORK.GRAPE1.NOTE: The data set WORK.GRAPE2 has 24 observations and 6 variables.NOTE: DATA statement used (Total process time):real time 0.00 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 960.37kOS Memory 29356.00kTimestamp 04/01/2024 11:52:35 PMStep Count 138 Switch Count 2Page Faults 0Page Reclaims 175Page Swaps 0Voluntary Context Switches 12Involuntary Context Switches 0Block Input Operations 0Block Output Operations 26490 proc print data=grape2;91 title3 'Data set with one case per observation';92 run;NOTE: There were 24 observations read from the data set WORK.GRAPE2.NOTE: PROCEDURE PRINT used (Total process time):real time 0.03 secondsuser cpu time 0.03 secondssystem cpu time 0.00 secondsmemory 1080.12kOS Memory 29096.00kTimestamp 04/01/2024 11:52:35 PMStep Count 139 Switch Count 1Page Faults 0Page Reclaims 124Page Swaps 0Voluntary Context Switches 10Involuntary Context Switches 0Block Input Operations 0Block Output Operations 169394 /* It's better to use arrays */9596 data grape3;97 set grape1;98 array s{3} sales1-sales3;99 do j = 1 to 3;100 price = j; sales = s{j}; output;101 end;102 drop j sales1-sales3;103NOTE: There were 8 observations read from the data set WORK.GRAPE1.NOTE: The data set WORK.GRAPE3 has 24 observations and 3 variables.NOTE: DATA statement used (Total process time):real time 0.00 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 942.03kOS Memory 29356.00kTimestamp 04/01/2024 11:52:35 PMStep Count 140 Switch Count 2Page Faults 0Page Reclaims 129Page Swaps 0Voluntary Context Switches 12Involuntary Context Switches 0Block Input Operations 0Block Output Operations 264104 proc print data=grape3;105 run;NOTE: There were 24 observations read from the data set WORK.GRAPE3.NOTE: PROCEDURE PRINT used (Total process time):real time 0.02 secondsuser cpu time 0.02 secondssystem cpu time 0.00 secondsmemory 742.37kOS Memory 29352.00kTimestamp 04/01/2024 11:52:35 PMStep Count 141 Switch Count 0Page Faults 0Page Reclaims 71Page Swaps 0Voluntary Context Switches 1Involuntary Context Switches 0Block Input Operations 0Block Output Operations 8106107 proc glm data = grape3 plots=none;108 title3 'Brain dead between cases analysis';109 class price;110 model sales=price;111 lsmeans price / pdiff tdiff adjust = bon;112NOTE: PROCEDURE GLM used (Total process time):real time 0.07 secondsuser cpu time 0.07 secondssystem cpu time 0.00 secondsmemory 2614.21kOS Memory 30904.00kTimestamp 04/01/2024 11:52:35 PMStep Count 142 Switch Count 3Page Faults 0Page Reclaims 448Page Swaps 0Voluntary Context Switches 24Involuntary Context Switches 0Block Input Operations 0Block Output Operations 312113 proc mixed data=grape3;114 title3 'Proc mixed with unknown covariance structure and lsmeans';115 title4 'Compare F = 29.66, p = 0.0008';116 class price;117 model sales = price;118 repeated / type=un subject=store r;119 lsmeans price / pdiff tdiff adjust = bon;120 /* Gives exactly pairwise matched t-tests in this case. */121NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.08 secondsuser cpu time 0.08 secondssystem cpu time 0.01 secondsmemory 1425.18kOS Memory 30380.00kTimestamp 04/01/2024 11:52:35 PMStep Count 143 Switch Count 4Page Faults 0Page Reclaims 250Page Swaps 0Voluntary Context Switches 31Involuntary Context Switches 0Block Input Operations 0Block Output Operations 312122 proc mixed data=grape3;123 title3 'Proc mixed with compound symmetry cov. structure and contrasts';124 title4 'Compare F = 49.35, p < 0.0001';125 class price;126 model sales = price;127 contrast '1vs2' price 1 -1 0;128 contrast '1vs3' price 1 0 -1;129 contrast '2vs3' price 0 1 -1;130 repeated / type=cs subject=store r;131132 run;NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.07 secondsuser cpu time 0.07 secondssystem cpu time 0.00 secondsmemory 1201.15kOS Memory 30636.00kTimestamp 04/01/2024 11:52:36 PMStep Count 144 Switch Count 4Page Faults 0Page Reclaims 136Page Swaps 0Voluntary Context Switches 32Involuntary Context Switches 1Block Input Operations 0Block Output Operations 296133 quit;134135136137 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;149