1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 /* multilogit.sas */
72 title2 'Multinomial Logit Model';
73 %include '/home/brunner0/441s20/mathread2.sas';
NOTE: Format YNFMT is already on the library WORK.FORMATS.
NOTE: Format YNFMT has been output.
NOTE: Format CRSFMT is already on the library WORK.FORMATS.
NOTE: Format CRSFMT has been output.
NOTE: Format NFMT is already on the library WORK.FORMATS.
NOTE: Format NFMT has been output.
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 244.34k
OS Memory 30116.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 120 Switch Count 0
Page Faults 0
Page Reclaims 25
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 32
194 /* mathread2.sas creates missused (any of hsgpa hscalc precalc missing)
195 and outcome (Pass-Fail-Gone)*/
196
NOTE: The infile '/home/brunner0/441s20/exploremath.data.txt' is:
Filename=/home/brunner0/441s20/exploremath.data.txt,
Owner Name=brunner0,Group Name=oda,
Access Permission=-rw-r--r--,
Last Modified=26Jan2020:19:49:34,
File Size (bytes)=44583
NOTE: 579 records were read from the infile '/home/brunner0/441s20/exploremath.data.txt'.
The minimum record length was 75.
The maximum record length was 75.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
99 at 110:24 99 at 111:18 142 at 181:14 204 at 181:21
NOTE: The data set WORK.MATHEX has 579 observations and 36 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 906.62k
OS Memory 30632.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 121 Switch Count 2
Page Faults 0
Page Reclaims 104
Page Swaps 0
Voluntary Context Switches 17
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 520
197 proc freq data=mathex;
198 title3 'Outcome by passed just to check';
199 tables outcome*passed
200 / norow nocol nopercent missing;
201 run;
NOTE: There were 579 observations read from the data set WORK.MATHEX.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.03 seconds
user cpu time 0.03 seconds
system cpu time 0.00 seconds
memory 3273.40k
OS Memory 31408.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 122 Switch Count 5
Page Faults 0
Page Reclaims 325
Page Swaps 0
Voluntary Context Switches 27
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 536
202
203 proc freq data=mathex;
204 title3 'Missused by Outcome with proc freq';
205 tables missused * outcome / nocol nopercent chisq;
206 run;
NOTE: There were 579 observations read from the data set WORK.MATHEX.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.03 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 1540.43k
OS Memory 31664.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 123 Switch Count 5
Page Faults 0
Page Reclaims 225
Page Swaps 0
Voluntary Context Switches 35
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 528
207
208 /* Probabilities
209 pi1 = P(Gone)
210 pi2 = P(Pass)
211 pi3 = P(Fail)
212
213 Multinomial Logit model for missused by outcome is
214
215 ln(pi1/pi3) = beta01 + beta11 x Gone vs. Fail
216 ln(pi2/pi3) = beta02 + beta12 x Pass vs. Fail
217 */
218
219
220 proc logistic data=mathex outest=ParmNames;
221 title3 'Misssused by Outcome with proc logistic';
222 model outcome (ref='Fail') = missused / link = glogit;
223 contrast 'Hsgpa, hscalc or precalc missing' missused 1;
224 run;
NOTE: PROC LOGISTIC is fitting the generalized logit model. The logits modeled contrast each response category against the
reference category (outcome='Fail').
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: There were 579 observations read from the data set WORK.MATHEX.
NOTE: The data set WORK.PARMNAMES has 1 observations and 10 variables.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.08 seconds
user cpu time 0.08 seconds
system cpu time 0.01 seconds
memory 2805.40k
OS Memory 32956.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 124 Switch Count 3
Page Faults 0
Page Reclaims 403
Page Swaps 0
Voluntary Context Switches 23
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 336
225
226
227 proc transpose data=ParmNames;
228 run;
NOTE: There were 1 observations read from the data set WORK.PARMNAMES.
NOTE: The data set WORK.DATA2 has 5 observations and 3 variables.
NOTE: PROCEDURE TRANSPOSE used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 2717.25k
OS Memory 33968.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 125 Switch Count 4
Page Faults 0
Page Reclaims 221
Page Swaps 0
Voluntary Context Switches 26
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 528
229 proc print;
230 run;
NOTE: There were 5 observations read from the data set WORK.DATA2.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 606.00k
OS Memory 31912.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 126 Switch Count 0
Page Faults 0
Page Reclaims 61
Page Swaps 0
Voluntary Context Switches 1
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
231
232 proc logistic data = mathex;
233 title3 'Contrast versus test';
234 model outcome (ref='Fail') = missused / link = glogit;
235 contrast 'Missused method 1' missused 1;
236 MissusedMethod2: test missused_Pass = missused_Gone = 0;
237 run;
NOTE: PROC LOGISTIC is fitting the generalized logit model. The logits modeled contrast each response category against the
reference category (outcome='Fail').
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: There were 579 observations read from the data set WORK.MATHEX.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.08 seconds
user cpu time 0.09 seconds
system cpu time 0.00 seconds
memory 2357.87k
OS Memory 32952.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 127 Switch Count 1
Page Faults 0
Page Reclaims 194
Page Swaps 0
Voluntary Context Switches 10
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 56
238
239 proc iml;
NOTE: IML Ready
240 title3 'Estimate Probabilities using output from proc logistic';
241 b01 = 0.3878;
241 ! b11 = 0.7209;
241 ! /* Gone */
242 b02 = 1.4123;
242 ! b12 = -0.6461;
242 ! /* Pass */
243 missused = 0;
244 L1 = b01 + b11*missused;
245 L2 = b02 + b12*missused;
246 denom = 1 + exp(L1) + exp(L2);
247 Gone = exp(L1)/denom;
247 ! Pass = exp(L2)/denom;
247 ! Fail = 1/denom;
248 print "Not missing:" Fail Gone Pass;
249 missused = 1;
250 L1 = b01 + b11*missused;
251 L2 = b02 + b12*missused;
252 denom = 1 + exp(L1) + exp(L2);
253 Gone = exp(L1)/denom;
253 ! Pass = exp(L2)/denom;
253 ! Fail = 1/denom;
254 print "Yes Missing:" Fail Gone Pass;
255 run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
256
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
real time 0.01 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 542.71k
OS Memory 31652.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 128 Switch Count 1
Page Faults 0
Page Reclaims 133
Page Swaps 0
Voluntary Context Switches 10
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
257 proc freq data = mathex;
258 title3 'Missused by outcome again for comparison';
259 tables missused * outcome / nocol nopercent;
260 run;
NOTE: There were 579 observations read from the data set WORK.MATHEX.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.02 seconds
user cpu time 0.03 seconds
system cpu time 0.00 seconds
memory 1299.65k
OS Memory 32432.00k
Timestamp 03/21/2020 01:26:35 AM
Step Count 129 Switch Count 5
Page Faults 0
Page Reclaims 186
Page Swaps 0
Voluntary Context Switches 34
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 544
261
262 /* Lots of exploration is not shown here. */
263
264 proc logistic data = mathex;
265 title3 'hsgpa hscalc precalc mtongue';
266 model outcome (ref='Fail') =
267 hsgpa hscalc precalc mtongue / link = glogit;
268 run;
NOTE: PROC LOGISTIC is fitting the generalized logit model. The logits modeled contrast each response category against the
reference category (outcome='Fail').
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: There were 579 observations read from the data set WORK.MATHEX.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.09 seconds
user cpu time 0.09 seconds
system cpu time 0.00 seconds
memory 2424.06k
OS Memory 32952.00k
Timestamp 03/21/2020 01:26:36 AM
Step Count 130 Switch Count 1
Page Faults 0
Page Reclaims 209
Page Swaps 0
Voluntary Context Switches 10
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 64
269
270 /* Allowing for academic background, students whose first language is English
271 are less likely to disappear as opposed to failing the course, and less likely to
272 Pass as opposed to failing. If this is replicated, it will be very
273 interesting. Explore further.
274
275 /************************** Replication ***********************
276 For interpretation, want to replicate 8 findings:
277 Gone vs. Fail and Pass vs. Fail for each explanatory variable.
278 ***************************************************************/
279 %include '/home/brunner0/441s20/readreplic.sas';
NOTE: Format YNFMT is already on the library WORK.FORMATS.
NOTE: Format YNFMT has been output.
NOTE: Format CRSFMT is already on the library WORK.FORMATS.
NOTE: Format CRSFMT has been output.
NOTE: Format NFMT is already on the library WORK.FORMATS.
NOTE: Format NFMT has been output.
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 246.25k
OS Memory 31652.00k
Timestamp 03/21/2020 01:26:36 AM
Step Count 131 Switch Count 0
Page Faults 0
Page Reclaims 14
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
392 if (0<=mark<=49) then outcome = 'Fail';
393 else if (50<=mark<=100) then outcome = 'Pass';
394 else outcome = 'Gone';
395
NOTE: The infile '/home/brunner0/441s20/replicmath.data.txt' is:
Filename=/home/brunner0/441s20/replicmath.data.txt,
Owner Name=brunner0,Group Name=oda,
Access Permission=-rw-r--r--,
Last Modified=26Jan2020:19:49:13,
File Size (bytes)=38214
NOTE: 579 records were read from the infile '/home/brunner0/441s20/replicmath.data.txt'.
The minimum record length was 64.
The maximum record length was 64.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
81 at 307:24 81 at 343:18
NOTE: The data set WORK.REPLIC has 579 observations and 35 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 902.46k
OS Memory 31912.00k
Timestamp 03/21/2020 01:26:36 AM
Step Count 132 Switch Count 2
Page Faults 0
Page Reclaims 83
Page Swaps 0
Voluntary Context Switches 20
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 520
396 proc logistic data = replic;
397 title2 'Replicate hsgpa hscalc precalc mtongue 0.05/8 = .00625';
398 model outcome (ref='Fail') = hsgpa hscalc precalc mtongue / link = glogit;
399
400
401 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
412