/******************* senicreg1.sas *****************/ /* Basic multiple regression on SENIC Data */ /***************************************************/ %include '/folders/myfolders/2453f15/senicread.sas'; /* senicread.sas reads data, etc. */ title2 'Multiple Regression One'; /* Make indicator dummy vars. These definitions could (should) be in senicdef.sas */ if region = 1 then r1=1; else r1=0; /* Northeast */ if region = 2 then r2=1; else r2=0; /* North Central */ if region = 3 then r3=1; else r3=0; /* South, and 4=West */ if medschl = 'Y' then mschool = 1; else if medschl = 'N' then mschool = 0; /* mschool is an indicator for medical school = yes. Note what happens to missing values. */ proc freq; title3 'Check new variable mschool'; tables mschool*medschl /norow nocol nopercent missing; proc reg; title3 'Without xratio and culratio'; model infrisk = stay age nbeds census nurses service r1-r3 mschool; Region: test r1=r2=r3=0; Size: test nbeds=census=nurses=0; proc reg; title3 'With xratio and culratio'; model infrisk = stay age nbeds census nurses service xratio culratio r1-r3 mschool; Region: test r1=r2=r3=0; Size: test nbeds=census=nurses=0;