Skip to content

Residual Plots

3 messages · Shivi82, Jim Lemon, MacQueen, Don

#
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. eval$bty_avg
is my  response variable and residual is the var I have created using resid
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: http://r.789695.n4.nabble.com/Residual-Plots-tp4707138.html
Sent from the R help mailing list archive at Nabble.com.
#
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 <shivibhatia at ymail.com> wrote:
#
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