/* ncinfm.sas */ /* */ /* read infant mortality data */ /* */ options ls=80 ; data infm ; length county $12 ; ***** tab delimited ; infile 'ncinfmort.txt' dlm='09'x dsd firstobs=6 ; if( _n_ > 100 ) then stop ; * don't read footer ; input county totd totrate whd whrate mind minrate ; run ; /* */ /* read county economic data */ data econ ; length county $12 ; * long county names ; infile 'NCCounty03q4.txt' dlm='09'x firstobs=2 ; /* ***** skip some vars */ input fips county cpop cpopr x1-x7 hinc pcpi90 pcpi01 pov ; county = upcase(county) ; * same case as above ; drop x1-x7 ; run ; /* */ /* put them together */ /* but sort first */ proc sort data=infm ; by county ; run ; proc sort data=econ ; by county ; run ; data both ; merge infm econ ; by county ; * always merge by ; run ; /* */ /* now the regression analysis */ /* avoid the smallest counties but what */ /* about Wake & Mecklenburg ? */ proc reg data=both ; where ( 2 < cpopr < 76 ) ; model totrate = pcpi01 ; * per capita personal income ; title 'regression analysis of infant mortality on income' ; run ; /* may be useful later */ proc means data=both mean var css ; var pcpi01 ; run ; proc plot data=both ; plot totrate*pcpi01 ; run ;