19
Analysis of Residuals ©2005 Dr. B. C. Paul

Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Embed Size (px)

Citation preview

Page 1: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Analysis of Residuals

©2005 Dr. B. C. Paul

Page 2: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Examining Residuals of Regression (From our Previous Example)

Set up your linear regression in theUsual manner.

Page 3: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Selecting Plots

After setting your dependent andIndependent variables and beforeClicking ok, click plots instead.

Page 4: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Picking Residual Plots

Plot the residual on the Y axisAgainst the predicted value onThe X axis.

Ask for Histograms and normalProbability plots.

Page 5: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

More Plots

Use the next button to allow youTo select another plot.

Then enter the residual on theY axis against the dependentVariable.

Finally tell the computer toContinue.

Page 6: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

You Will Still Get the Normal Tables we Saw Before

Scroll downTo see whatIs new.

Page 7: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Some Abnormality in the Histogram

A Histogram is a bar chartShowing the number ofResults in different numericIntervals.

In this case we can see thereMay be two families ofUnexplained events andOne of them is causing theModel to over-predict(note the negative tail).

Page 8: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

We Have a Cumulative Probability Plot

Cumulative probabilityCounts all the samples That should have comeUp by a certain point(it is an integration of theProbability distribution).

Normal would plot on aStraight line. This isSomewhat straight butThe slope at the center isWrong and the tailsDrift off. (More commentaryOn reading cumulativeProbability plots later).

Page 9: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Look for Trends that have been systematically missed

This plot showsThe residual(amount weMissed by) againstThe predictedValue.

If there is a trendIn the points itMay tell usWhat we missed.

In this case it isPretty scattered.

Page 10: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Missing Trends

We are still missingSomething becauseThere is a definiteTrend in the residualsRelative to the actualMPG.

We are missing aVariable or factor.(it might be linear).

Page 11: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Consider Another Data Set

We have an Independent andDependent Variable.

(The data set could representAny problem we wished toModel).

Page 12: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Tell it to do a Regression of the Dependent against the Independent Variable.

Be sure we also ask for ourResidual plots.

Page 13: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Go to Results

The R^2 value is 0.996 – darnOne is a straight line. How muchCloser do you want to be.

This regression looks like itFits like a glove – TheMean Square for regressionIs 5 orders of magnitudeGreater than the MS for error.

The F statistic blows the nullHypothesis off the map.

Page 14: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

No Chance the Slope or Constant are Zero

Page 15: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

There is some evidence the distribution of residuals is a little skewed.

Page 16: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

The residual distribution is definitely skewed off to one side

Page 17: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

Oh Boy – Can You See the Trend we missed here?

Here the residualsFollow a clear andUnmistakable shape ofAn effect we missed.

Page 18: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

This Thing Has a Second Order or Curved Effect

Page 19: Analysis of Residuals ©2005 Dr. B. C. Paul. Examining Residuals of Regression (From our Previous Example) Set up your linear regression in the Usual manner

OK – Now What Do I Do?

Linear Regression Rapidly and Quantitatively Fits a simple linear function of one variable to another.

We noted that there had to be other effects present on the gas mileage but linear regression only handles one independent variable.

We also noted that sometimes there our second or higher order effects of a variable present – a straight line just doesn’t fit that

We may want to have some more powerful tools to fall back on (we just try the easy stuff first).