/* RMA 3.2.2021 */ proc import datafile="C:\Users\jarvah1\Downloads\DATA FOR EXERCISES-20210126\mroz.xlsx" dbms=xlsx out=mroz replace; run; proc print data=mroz (obs=15); proc contents data=mroz; run; /* descriptive statistics */ proc means data=mroz n mean median maxdec=3; var inlf nwifeinc educ exper expersq age kidslt6 kidsge6; run; /* OLS regression - intercept model */ ods graphics off; proc reg data=mroz; model inlf= ; run; quit; /* OLS regression - full model */ proc reg data=mroz; model inlf=nwifeinc educ exper expersq age kidslt6 kidsge6; output out=mroz_out predicted=pred residual=res; run; quit; /* "predicted" probabilities, see Allison's book chapter */ proc print data=mroz_out; var inlf pred res; run; /* logistic regression - intercept model */ proc logistic data=mroz; model inlf(EVENT="1")=; run; /* logistic regression - full model */ proc logistic data=mroz; model inlf(EVENT="1")=nwifeinc educ exper expersq age kidslt6 kidsge6; ods output parameterestimates=parms; score data=mroz; run; /* type 'proc logistic table names' to Google to see what tables you can output */ /* type 'proc logistic score' to Google to see more information about the statement */ proc contents data=data1; run; proc print data=data1; var inlf P_0 P_1; run; /* all the probabilities are between 0 and 1 */ proc means data=data1 n mean min max; var inlf P_0 P_1; run; /* export parameter estimates in order to create the calculator */ proc export data=parms outfile="C:\Users\jarvah1\Downloads\DATA FOR EXERCISES-20210126\parms.xlsx" dbms=xlsx replace; run;