options linesize=70 pagesize=50; data a; infile 'data.txt'; input ravlchm hhinc black hslds setr vac indexr pstu roadacc roadcap transacc transcap; /* This is to define log transformations of the 4 predictors of interest*/ lra = log(roadacc+0.5); lrc = log(roadcap+0.5); lta = log(transacc+0.5); ltc = log(transcap+0.5); /* this is to define log transf of response */ lrav = log(ravlchm); run; /* Model for the raw data */ proc reg data=a; model ravlchm = hhinc black hslds setr vac indexr pstu roadacc roadcap transacc transcap /P R COLLIN;; output out=b p=pred r=res; /* Model for the raw response and the log of the 4 predictors */ proc reg data=a; model ravlchm = hhinc black hslds setr vac indexr pstu lra lrc lta ltc /P R COLLIN;; output out=b p=pred r=res; /* Model for the log response and the log of the 4 predictors */ proc reg data=a; model lrav = hhinc black hslds setr vac indexr pstu lra lrc lta ltc /P R COLLIN;; output out=b p=pred r=res; /* To plot residuals in the above cases */ proc plot data=b; plot res*pred res*( lra lrc lta ltc ); run; /* to do the model selection for the second example*/ proc reg data=a; model lrav = hhinc black hslds setr vac indexr pstu lra lrc lta ltc /selection=adjrsq; /* remember after model selection do the regression for the final model */