简体   繁体   中英

How to obtain the QQ plot of a spline model R

I have a model that I've fitted using splines:

ssfit.3 <- smooth.spline(anage$lifespan ~ log(anage$Metabolic.by.mass), 
                         df = 3)

I'm trying to obtain the model diagnostics such as the residual plot and the QQ plot for this model. I know for a linear model you can do

plot(lm)

which outputs all the different plots. How can I do this with spline models since plot(ssfit.3) does not output the same?

Extract the residuals and use qqnorm() / qqline() .

example(smooth.spline) ## to get a model to work with
qqnorm(residuals(s2m))
qqline(residuals(s2m))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM