/* MathLogReg2.sas */ %include '/folders/myfolders/441s16/Lecture/readmath2b.sas'; title2 'Predict Passing the course (Y-N) with Logistic Regression'; /* c1 = 'Catch-up' c2 = 'Mainstream' c3 = 'Elite' */ proc logistic descending order=internal; title3 'HS variables'; model passed = hsgpa hscalc hsengl; /* Decision: Drop hsengl */ proc logistic descending order=internal; title3 'HS gpa and calc, course2 and diagnostic test'; class course2 / param=ref; model passed = hsgpa hscalc course2 precalc calc; contrast 'Course' course2 1 0, course2 0 1; proc logistic descending order=internal; title3 'HS gpa and calc, precalc and total score'; model passed = hsgpa hscalc precalc totscore; precalc_n_totscore: test precalc = totscore = 0; /* Decision: Keep precalc rather than totscore */ proc logistic descending order=internal; title3 'Try gender, ethnic and mother tongue controlling for good stuff'; class ethnic (param=ref ref='East Indian'); /* Specifying a reference category that's not the last value */ model passed = hsgpa hscalc precalc ethnic gender mtongue; contrast 'Demographics' ethnic 1 0 0 0 0, ethnic 0 1 0 0 0, ethnic 0 0 1 0 0, ethnic 0 0 0 1 0, ethnic 0 0 0 0 1, gender 1, mtongue 1 / e; /* Display the effect matrix */ /* Decision: Forget about gender and ethnicity. */