1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;NOTE: ODS statements in the SAS Studio environment may disable some output features.7172 /* monkey2.sas (2020 version) */73 title 'Covariance structure approach on the monkey data';74 title2 'Primate hippocampal function: Zola-Morgan and Squire (1990)';75 /* Science, Vol. 250 (12 Oct. 1990) , Pages 288-290 */7677 data remember;78 infile '/home/brunner0/441s20/monkey.data.txt' firstobs=2;79 input monkey $ treatment $ week2 week4 week8 week12 week16;80 /* Need one line per response */81 id = _n_; /* A little more convenient than the monkeys' names */82 t2=2; t4=4; t8=8; t12=12; t16=16; /* Time since learning the task in weeks */83 array t{5} t2 -- t16;84 array week{5} week2 -- week16;85 do j = 1 to 5;86 time = t{j};87 score = week{j};88 output;89 end;90 keep monkey treatment id time score;91NOTE: The infile '/home/brunner0/441s20/monkey.data.txt' is:Filename=/home/brunner0/441s20/monkey.data.txt,Owner Name=brunner0,Group Name=oda,Access Permission=-rw-r--r--,Last Modified=01Mar2020:17:38:09,File Size (bytes)=854NOTE: 18 records were read from the infile '/home/brunner0/441s20/monkey.data.txt'.The minimum record length was 42.The maximum record length was 42.NOTE: The data set WORK.REMEMBER has 90 observations and 5 variables.NOTE: DATA statement used (Total process time):real time 0.03 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 780.50kOS Memory 31400.00kTimestamp 03/04/2020 03:52:40 PMStep Count 68 Switch Count 2Page Faults 1Page Reclaims 171Page Swaps 0Voluntary Context Switches 17Involuntary Context Switches 0Block Input Operations 72Block Output Operations 26492 proc print data=remember (obs=10); /* Just first 10 lines */93 run;NOTE: There were 10 observations read from the data set WORK.REMEMBER.NOTE: PROCEDURE PRINT used (Total process time):real time 0.03 secondsuser cpu time 0.03 secondssystem cpu time 0.01 secondsmemory 2183.00kOS Memory 31656.00kTimestamp 03/04/2020 03:52:40 PMStep Count 69 Switch Count 0Page Faults 0Page Reclaims 157Page Swaps 0Voluntary Context Switches 0Involuntary Context Switches 0Block Input Operations 0Block Output Operations 89495 proc mixed data=remember;96 title3 'Unstructured Covariance Matrix';97 class treatment time;98 model score = treatment|time;99 repeated / type=un subject=id r;100 /* Could have used subject=monkey, but then monkey must be declared in101 class because it's character-valued. */102 run;NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.10 secondsuser cpu time 0.10 secondssystem cpu time 0.00 secondsmemory 1820.65kOS Memory 32428.00kTimestamp 03/04/2020 03:52:40 PMStep Count 70 Switch Count 3Page Faults 0Page Reclaims 257Page Swaps 0Voluntary Context Switches 24Involuntary Context Switches 0Block Input Operations 0Block Output Operations 296103104 /* Could justify compound symmetry: Each monkey brings her own special talent105 for discrimination learning. */106107 proc mixed data=remember;108 title3 'Compound Symmetry';109 class treatment time;110 model score = treatment|time;111 repeated / type=cs subject=id r;112 run;NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.09 secondsuser cpu time 0.10 secondssystem cpu time 0.00 secondsmemory 1172.43kOS Memory 32684.00kTimestamp 03/04/2020 03:52:40 PMStep Count 71 Switch Count 3Page Faults 0Page Reclaims 198Page Swaps 0Voluntary Context Switches 22Involuntary Context Switches 0Block Input Operations 0Block Output Operations 304113114 /* You can test hypotheses with proc mixed that are out of reach with115 other software. */116117 data forget;118 set remember;119 if treatment = 'CONTROL' then treat=1; else treat=2;120 combo = 100*treat + time;121 /*122 proc freq;123 tables (treatment time) * combo / norow nocol nopercent missing;124 */NOTE: There were 90 observations read from the data set WORK.REMEMBER.NOTE: The data set WORK.FORGET has 90 observations and 7 variables.NOTE: DATA statement used (Total process time):real time 0.00 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 947.62kOS Memory 32684.00kTimestamp 03/04/2020 03:52:40 PMStep Count 72 Switch Count 2Page Faults 0Page Reclaims 126Page Swaps 0Voluntary Context Switches 11Involuntary Context Switches 0Block Input Operations 0Block Output Operations 264125 proc means mean maxdec=3;126 class combo;127 var score;128129 quit;NOTE: There were 90 observations read from the data set WORK.FORGET.NOTE: PROCEDURE MEANS used (Total process time):real time 0.02 secondsuser cpu time 0.02 secondssystem cpu time 0.00 secondsmemory 8905.46kOS Memory 41148.00kTimestamp 03/04/2020 03:52:40 PMStep Count 73 Switch Count 1Page Faults 0Page Reclaims 2240Page Swaps 0Voluntary Context Switches 19Involuntary Context Switches 0Block Input Operations 0Block Output Operations 0130 ods select Contrasts Estimates;131 proc mixed data=forget;132 title3 'Test treatment effect at each week, and estimate one difference';133 class combo;134 model score = combo;135 repeated / type=cs subject=id r;136 /* Control Treated */137 /* 2 4 8 12 16 2 4 8 12 16 */138 /* ------------------------------- */139 contrast 'TreatAtWeek2' combo 1 0 0 0 0 -1 0 0 0 0;140 contrast 'TreatAtWeek4' combo 0 1 0 0 0 0 -1 0 0 0;141 contrast 'TreatAtWeek8' combo 0 0 1 0 0 0 0 -1 0 0;142 contrast 'TreatAtWeek12' combo 0 0 0 1 0 0 0 0 -1 0;143 contrast 'TreatAtWeek16' combo 0 0 0 0 1 0 0 0 0 -1;144 /* Estimate difference between Treated at Week 2 and Control at Week 16 */145 estimate 'Control16 minus Treated2'146 combo 0 0 0 0 1 -1 0 0 0 0 / CL;147 run;NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.03 secondsuser cpu time 0.03 secondssystem cpu time 0.01 secondsmemory 1290.18kOS Memory 33964.00kTimestamp 03/04/2020 03:52:40 PMStep Count 74 Switch Count 3Page Faults 0Page Reclaims 158Page Swaps 0Voluntary Context Switches 22Involuntary Context Switches 0Block Input Operations 0Block Output Operations 272148149150151152 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;163