残差图诊断

par(mfrow = c(2,2))
# 普通残差图
plot(fitted(model), residuals(model), xlab="拟合值", ylab="普通残差",pch=19)  
abline(h=0, lty=2)
# 删除残差图
plot(fitted(model), residuals(model)/(1-hatvalues(model)), xlab="拟合值", ylab="删除残差", pch=19)   
abline(h=0,lty=2)
# 学生化残差图
plot(fitted(model), rstandard(model), xlab="拟合值", ylab="学生化残差", ylim=c(-3.5,3.5), pch=19)  
abline(h=0, lty=2)
# 删除学生化残差图
plot(fitted(model), rstudent(model), xlab="拟合值", ylab="删除学生化残差", ylim=c(-3.5,3.5), pch=19)   
abline(h=0, lty=2)

残差图诊断

使用Plot做回归诊断图

  • 有无非线性关系

      plot(model,which=1)
    

残差对拟合值的散点图

  • 残差是否正态分布

      plot(model, which=2)
    

残差的QQ图

  • 是否有异方差

      plot(model, which=3)
    

标准化残差绝对值平方根对拟合值的散点图

  • 查看强影响点

      plot(model, which=4)
    

影响点诊断

Copyright © Euclid-Jie 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-08-09 05:34:52

results matching ""

    No results matching ""