[ Data Screening || Matrix Algebra with SAS/IML || Regression analysis || General Linear Models || Canonical correlation, Discriminant analysis || Logistic Regression || Factor Analysis || Clustering and scaling || SAS macro programs || Data sets || Programs]

Regression examples

These tutorial examples use a few different data sets to illustrate a variety of methods involved in regression analysis.
autocox.sas src output
Box-Cox transformation for the Auto data. Uses the BOXCOX macro to find a power transformation of MPG.
basecox.sas src output
Box-Cox transformation for the Baseball data. Uses the BOXCOX macro to find a power transformation of Salary.
bisqdunc.sas src output
Robust Regression - Duncan data. Uses the BISQUARE macro.
bisqfuel.sas src output
Robust Regression - Fuel data. Uses the BISQUARE macro.
bloodreg.sas src output
Testing homogeneity of regression. Compares models with different slopes and intercepts in the BLOOD data.
bootdunc.sas src output
Bootstrap Regression - Duncan data. Uses the BOOT macro.
crossval.sas src output
Plot of predictive R-square, showing effects of shrinkage.
detroit1.sas src output
Predicting Detroit homicide rates. See the description of DETROIT.SAS under Data sets.
detroit2.sas src output
Stepwise selection methods on Detroit Homicide data.
evappca.sas src output
Incomplete principal components regression.
fitbipl.sas src output
Fitness data: Biplot.
fitcp.sas src
Fitness Data: CP Plot.
fitcolin.sas src output
Fitness Data: Collinearity diagnostics.
fitinfl.sas src output
Fitness Data: Influence plot, bubble proportional to Cook's Distance
fitness2.sas src output
Influence diagnostics and partial residual plots
fitness3.sas src output
Various selection methods for Fitness data
fitness4.sas src output
Cross validation of a regression model. We hold back a portion of the data from the fit, and evaluate how well the model predicts in the hold-back sample.
fitpart.sas src output
Fitness data: Partial residual plots.
fitstep.sas src output
Illustrate stepwise selection using the Fitness Data.
fuelcox.sas src output
Fuel Consumption: Box Cox Transformation Plots.
fuelcp.sas src output
C(p) and related plots for fuel data.
fuelerr.sas src output
Fuel Consumption: Demonstrates effects of errors-in-predictors.
fuelinfl.sas src output
Fuel Consumption: Influence Plot. Uses the INFLPLOT macro to show the influence of a few observations on prediction of fuel consumption.
fuelpart.sas src output
Fuel data: Partial residual plots
fuelr1.sas src output
Fuel data: Building a regression model
health.sas src output
Suppression effects: Health, Height and Weight
mregppvt.sas src output
Multivariate multiple regression
regdemo.sas src output
Regression example, using SAS/IML. A set of SAS/IML modules to carry out regression computations and hypothesis tests. Duplicates PROC REG facilities, while the IML program shows how it's done.
reginfl.sas src output
Influential Observations in Multiple Regression. Fictitious data to illustrate various combinations of residual and leverage to produce influential observations.
robdunc.sas src output
Robust Regression - Duncan data, using the ROBUST macro.
robfuel.sas src output
Bisquare Robust Regression - Fuel data, using the ROBUST macro.
robreg.sas src output
Robust Regression using IRLS(via PROC NLIN; superceded by ROBUST macro).
scatfuel.sas src output
Fuel data: scatterplot matrix
stepsim.sas src output
Stepwise regression simulation example NO real predictors. The maxim if you torture the data long enough, you can make it confess to anything is illustrated by constructing 100 random predictors, all statistically independent of the response. How many do you suppose will be significant at the .05 level?
stepsim2.sas src output
Stepwise simulation experiment: add random predictors to Fitness Data. What do you think happens if you throw a whole bunch of random predictors into stepwise regression with a real data set?
suppress.sas src output
Demonstrate suppression effect. Fictitious data on three variables are used to illustrate a situation in which an additional variable can make a greater extra contribution to regression, SSR(X2|X1), than it does by itself, SSR(X2).
suppres2.sas src output
Partial residual plots for supression example
therboot.sas src output
Simple Regression: Bootstrap samples and estimates
turnip.sas src output
Lurking variables: Turnip Green Data. Plots of results from a model to predict the quantity of Vitamin B2 in turnip greens reveal a surprising and unsuspected lurking variable.