"plot.new" error when checking normality of residuals using qqline()

Viewed 86

I would like to check if my model (standardized) residuals are normally distributed.

model <- lm(ratiopermonth ~ Greenspace, data = mydata)
qqline(rstandard(model))

But I got an error message:

plot.new has not been called yet

What is wrong?

1 Answers

qqline is to be used after qqnorm.

r <- rstandard(model)
qqnorm(r)
qqline(r)
Related