title 'Fuel data: Building a regression model'; %include data(fuel) ; *options LS=90 PS=62; proc corr nosimple; var tax inc drivers road pop fuel; proc plot hpercent=50 vpercent=50 ; plot fuel * (tax inc drivers road) = state ; format fuel 4.0 tax 4.1 inc 6.0 drivers 4.3; run; proc reg data=fuel; model fuel = tax drivers road inc pop / selection=rsquare best=4 cp aic; title2 'RSquare analysis'; run; proc reg data=fuel; model fuel = tax drivers road inc pop / selection=stepwise; title2 'Stepwise analysis'; run; proc reg data=fuel; id state; model fuel = tax drivers inc pop/ r ss1 ss2 influence partial; plot r. * p. = state rstudent. * h. = state ; title2 'A closer look at the stepwise model'; run; data fuel; set fuel; popden = log10 ( pop / area); label popden = 'log Population Density'; proc plot; plot fuel * popden = state; proc reg; model fuel = popden tax drivers road inc / selection = stepwise; title 'Using population density';