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
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
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
3 matches
Mail list logo