R 读取回归模型的信息

参考博客:

http://blog.sina.com.cn/s/blog_8f5b2a2e0101fmiq.html

https://blog.csdn.net/huangyouyu523/article/details/78565159

fm = lm(y~x)        #线性回归模型
info = summary(fm)  #提取模型资料
info$coeff          #提取回归系数
info$r.square       #提取判定系数R方
info$adj.r.square   #提取调整判定系数R方
info$fstatistic     #F判定系数
deviance(fm)        #计算残差平方和
resid(fm)           #计算残差

  

posted @ 2019-10-24 12:08  从前有座山,山上  阅读(411)  评论(0编辑  收藏  举报