s-news
[Top] [All Lists]

Re: Fwd: plot.lm Response vs Fitted

To: "Richard M. Heiberger" <rmh@temple.edu>
Subject: Re: Fwd: plot.lm Response vs Fitted
From: Tim Hesterberg <timh@insightful.com>
Date: 18 Jan 2006 13:08:41 -0800
Cc: "Thompson, David" <david.thompson@mnr.gov.on.ca>, "s-news" <s-news@lists.biostat.wustl.edu>
In-reply-to: <b419872.7cac51f5.81be000@po-d.temple.edu> (rmh@temple.edu)
References: <b419872.7cac51f5.81be000@po-d.temple.edu>
In addition to showing multiple R^2, the plot of residuals vs fitted
can show lack of fit that doesn't show up in plots of y or residuals
against individual x's.

Here's an example:

n = 200
set.seed(0)
x = matrix( runif(n * 20), nrow = n)
temp = rowSums(x)
y = temp + temp^2 + rnorm(n)
fit = lm(y ~ x)
fit
plot(fit)
# Note that the lack of fit shows up clearly in the plot
# of residuals vs fitted

# In constrast, the lack of fit does not show up when
# plotting either y or residuals against individual x's
for(j in 1:4) plot(x[,j], y, ask=T)
for(j in 1:4) plot(x[,j], resid(fit), ask=T)



>---- Original message ----
>>I was trying to explain my use of residual diagnostic plots to a 
>>colleague when I realized that I do not have a handle on the use
>>of the 'Response vs Fitted Values' plot.
>
>
>
>In simple linear regression, the plot of y ~ y.hat is essentially the same
>as y ~ x, because y.hat = a + b*x is a rescaling of x.
>
>In multiple regression, the plot of y ~ y.hat is an illustration of multiple 
>R^2,
>the proportion of variability explained by the model,
>because the correlation of y and y.hat is exactly R.
>
>My book
>Statistical Analysis and Data Display
>An Intermediate Course
>with examples in S-Plus, R, and SAS
>Series : Springer Texts in Statistics 
>Heiberger, Richard M., Holland, Burt
>2004, 754 p., Hardcover
>ISBN: 0-387-40270-5 
>with online files at http://springeronline.com/0-387-40270-5
>
>has a very complete discussion of all six of the standard linear model
>diagnostic plots.
>
>Rich

Tim Hesterberg

========================================================
| Tim Hesterberg       Research Scientist              |
| timh@insightful.com  Insightful Corp.                |
| (206)802-2319        1700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax)  Seattle, WA 98109-3012, U.S.A.  |
|                      www.insightful.com/Hesterberg   |
========================================================
Download the S+Resample library from www.insightful.com/downloads/libraries

Two Research Scientist positions:
        data mining
        frailty/mixed effects
    http://www.insightful.com/company/jobs.asp


<Prev in Thread] Current Thread [Next in Thread>