[R] Residual Plots

MacQueen, Don macqueen1 at llnl.gov
Wed May 13 22:27:27 CEST 2015

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 MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550

On 5/13/15, 2:33 AM, "Shivi82" <shivibhatia at ymail.com> wrote:

>HI All,
>I Am creating a residual plot for my linear model.
>the code I created is : plot(eval$bty_avg,residuals,ylab="residuals",
>xlab="Score", main = "Residual Analysis")Here data set is eval.
>is my  response variable and residual is the var I have created using
>function to store the residuals.
>syntax used is : residuals<- resid(m_bty)
>However when I run the syntax I receive the following error message:-
>Error in eval$bty_avg : object of type 'closure' is not subsettable
>Please suggest. 
>View this message in context:
>Sent from the R help mailing list archive at Nabble.com.
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list