1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
71
72 /* 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 */
76
77 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;
91
NOTE: 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)=854
NOTE: 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 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 780.50k
OS Memory 31400.00k
Timestamp 03/04/2020 03:52:40 PM
Step Count 68 Switch Count 2
Page Faults 1
Page Reclaims 171
Page Swaps 0
Voluntary Context Switches 17
Involuntary Context Switches 0
Block Input Operations 72
Block Output Operations 264
92 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 seconds
user cpu time 0.03 seconds
system cpu time 0.01 seconds
memory 2183.00k
OS Memory 31656.00k
Timestamp 03/04/2020 03:52:40 PM
Step Count 69 Switch Count 0
Page Faults 0
Page Reclaims 157
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
94
95 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 in
101 class because it's character-valued. */
102 run;
NOTE: Convergence criteria met.
NOTE: PROCEDURE MIXED used (Total process time):
real time 0.10 seconds
user cpu time 0.10 seconds
system cpu time 0.00 seconds
memory 1820.65k
OS Memory 32428.00k
Timestamp 03/04/2020 03:52:40 PM
Step Count 70 Switch Count 3
Page Faults 0
Page Reclaims 257
Page Swaps 0
Voluntary Context Switches 24
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 296
103
104 /* Could justify compound symmetry: Each monkey brings her own special talent
105 for discrimination learning. */
106
107 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 seconds
user cpu time 0.10 seconds
system cpu time 0.00 seconds
memory 1172.43k
OS Memory 32684.00k
Timestamp 03/04/2020 03:52:40 PM
Step Count 71 Switch Count 3
Page Faults 0
Page Reclaims 198
Page Swaps 0
Voluntary Context Switches 22
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 304
113
114 /* You can test hypotheses with proc mixed that are out of reach with
115 other software. */
116
117 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 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 947.62k
OS Memory 32684.00k
Timestamp 03/04/2020 03:52:40 PM
Step Count 72 Switch Count 2
Page Faults 0
Page Reclaims 126
Page Swaps 0
Voluntary Context Switches 11
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
125 proc means mean maxdec=3;
126 class combo;
127 var score;
128
129 quit;
NOTE: There were 90 observations read from the data set WORK.FORGET.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.02 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 8905.46k
OS Memory 41148.00k
Timestamp 03/04/2020 03:52:40 PM
Step Count 73 Switch Count 1
Page Faults 0
Page Reclaims 2240
Page Swaps 0
Voluntary Context Switches 19
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
130 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 seconds
user cpu time 0.03 seconds
system cpu time 0.01 seconds
memory 1290.18k
OS Memory 33964.00k
Timestamp 03/04/2020 03:52:40 PM
Step Count 74 Switch Count 3
Page Faults 0
Page Reclaims 158
Page Swaps 0
Voluntary Context Switches 22
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 272
148
149
150
151
152 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
163