Re: [R] Residual Plots

2015-05-13 Thread MacQueen, Don
This example might help: tmp <- data.frame(x=1:10, y=rnorm(10)) foo <- lm(y~x, data=tmp) plot(tmp$x, residuals(foo)) It appears that eval$bty_avg is not what you think it is. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062

Re: [R] Residual Plots

2015-05-13 Thread Jim Lemon
Hi Shivi82, The error message suggests that "eval$bty_avg" is a function. What does: str(eval) say about its components? Jim On Wed, May 13, 2015 at 7:33 PM, Shivi82 wrote: > HI All, > I Am creating a residual plot for my linear model. > the code I created is : plot(eval$bty_avg,residuals,yla

Re: [R] residual plots

2008-11-25 Thread Greg Snow
One simple way is to use na.action=na.exclude rather than na.omit. This will still fit the regression without the missing rows, but if you use the resid function to extract the residuals, it will fill the deleted values with NA so that the vector is the same length (and correctly matches) the o