1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;7071 /* 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 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 244.34kOS Memory 30116.00kTimestamp 03/21/2020 01:26:35 AMStep Count 120 Switch Count 0Page Faults 0Page Reclaims 25Page Swaps 0Voluntary Context Switches 0Involuntary Context Switches 0Block Input Operations 0Block Output Operations 32194 /* mathread2.sas creates missused (any of hsgpa hscalc precalc missing)195 and outcome (Pass-Fail-Gone)*/196NOTE: 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)=44583NOTE: 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:21NOTE: The data set WORK.MATHEX has 579 observations and 36 variables.NOTE: DATA statement used (Total process time):real time 0.01 secondsuser cpu time 0.01 secondssystem cpu time 0.00 secondsmemory 906.62kOS Memory 30632.00kTimestamp 03/21/2020 01:26:35 AMStep Count 121 Switch Count 2Page Faults 0Page Reclaims 104Page Swaps 0Voluntary Context Switches 17Involuntary Context Switches 0Block Input Operations 0Block Output Operations 520197 proc freq data=mathex;198 title3 'Outcome by passed just to check';199 tables outcome*passed200 / 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 secondsuser cpu time 0.03 secondssystem cpu time 0.00 secondsmemory 3273.40kOS Memory 31408.00kTimestamp 03/21/2020 01:26:35 AMStep Count 122 Switch Count 5Page Faults 0Page Reclaims 325Page Swaps 0Voluntary Context Switches 27Involuntary Context Switches 0Block Input Operations 0Block Output Operations 536202203 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 secondsuser cpu time 0.04 secondssystem cpu time 0.00 secondsmemory 1540.43kOS Memory 31664.00kTimestamp 03/21/2020 01:26:35 AMStep Count 123 Switch Count 5Page Faults 0Page Reclaims 225Page Swaps 0Voluntary Context Switches 35Involuntary Context Switches 0Block Input Operations 0Block Output Operations 528207208 /* Probabilities209 pi1 = P(Gone)210 pi2 = P(Pass)211 pi3 = P(Fail)212213 Multinomial Logit model for missused by outcome is214215 ln(pi1/pi3) = beta01 + beta11 x Gone vs. Fail216 ln(pi2/pi3) = beta02 + beta12 x Pass vs. Fail217 */218219220 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 thereference 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 secondsuser cpu time 0.08 secondssystem cpu time 0.01 secondsmemory 2805.40kOS Memory 32956.00kTimestamp 03/21/2020 01:26:35 AMStep Count 124 Switch Count 3Page Faults 0Page Reclaims 403Page Swaps 0Voluntary Context Switches 23Involuntary Context Switches 1Block Input Operations 0Block Output Operations 336225226227 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 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 2717.25kOS Memory 33968.00kTimestamp 03/21/2020 01:26:35 AMStep Count 125 Switch Count 4Page Faults 0Page Reclaims 221Page Swaps 0Voluntary Context Switches 26Involuntary Context Switches 0Block Input Operations 0Block Output Operations 528229 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 secondsuser cpu time 0.01 secondssystem cpu time 0.00 secondsmemory 606.00kOS Memory 31912.00kTimestamp 03/21/2020 01:26:35 AMStep Count 126 Switch Count 0Page Faults 0Page Reclaims 61Page Swaps 0Voluntary Context Switches 1Involuntary Context Switches 0Block Input Operations 0Block Output Operations 8231232 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 thereference 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 secondsuser cpu time 0.09 secondssystem cpu time 0.00 secondsmemory 2357.87kOS Memory 32952.00kTimestamp 03/21/2020 01:26:35 AMStep Count 127 Switch Count 1Page Faults 0Page Reclaims 194Page Swaps 0Voluntary Context Switches 10Involuntary Context Switches 1Block Input Operations 0Block Output Operations 56238239 proc iml;NOTE: IML Ready240 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.256NOTE: Exiting IML.NOTE: PROCEDURE IML used (Total process time):real time 0.01 secondsuser cpu time 0.02 secondssystem cpu time 0.00 secondsmemory 542.71kOS Memory 31652.00kTimestamp 03/21/2020 01:26:35 AMStep Count 128 Switch Count 1Page Faults 0Page Reclaims 133Page Swaps 0Voluntary Context Switches 10Involuntary Context Switches 0Block Input Operations 0Block Output Operations 8257 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 secondsuser cpu time 0.03 secondssystem cpu time 0.00 secondsmemory 1299.65kOS Memory 32432.00kTimestamp 03/21/2020 01:26:35 AMStep Count 129 Switch Count 5Page Faults 0Page Reclaims 186Page Swaps 0Voluntary Context Switches 34Involuntary Context Switches 0Block Input Operations 0Block Output Operations 544261262 /* Lots of exploration is not shown here. */263264 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 thereference 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 secondsuser cpu time 0.09 secondssystem cpu time 0.00 secondsmemory 2424.06kOS Memory 32952.00kTimestamp 03/21/2020 01:26:36 AMStep Count 130 Switch Count 1Page Faults 0Page Reclaims 209Page Swaps 0Voluntary Context Switches 10Involuntary Context Switches 1Block Input Operations 0Block Output Operations 64269270 /* Allowing for academic background, students whose first language is English271 are less likely to disappear as opposed to failing the course, and less likely to272 Pass as opposed to failing. If this is replicated, it will be very273 interesting. Explore further.274275 /************************** 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 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 246.25kOS Memory 31652.00kTimestamp 03/21/2020 01:26:36 AMStep Count 131 Switch Count 0Page Faults 0Page Reclaims 14Page Swaps 0Voluntary Context Switches 0Involuntary Context Switches 0Block Input Operations 0Block Output Operations 0392 if (0<=mark<=49) then outcome = 'Fail';393 else if (50<=mark<=100) then outcome = 'Pass';394 else outcome = 'Gone';395NOTE: 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)=38214NOTE: 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:18NOTE: The data set WORK.REPLIC has 579 observations and 35 variables.NOTE: DATA statement used (Total process time):real time 0.00 secondsuser cpu time 0.00 secondssystem cpu time 0.00 secondsmemory 902.46kOS Memory 31912.00kTimestamp 03/21/2020 01:26:36 AMStep Count 132 Switch Count 2Page Faults 0Page Reclaims 83Page Swaps 0Voluntary Context Switches 20Involuntary Context Switches 0Block Input Operations 0Block Output Operations 520396 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;399400401 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;412