文档介绍:建立 ,收缩压与年龄,收缩压与体重、年龄的回归方程,进行相关估计和预测。
具体处理过程:
rm(list=ls())
rd=("",he Estimate Std. Error t value Pr(>|t|)
(Intercept) <2e-16 ***
weight <2e-16 ***
age <2e-16 ***
---
Signif. codes: 0 ‘***’ ‘**’ ‘*’ ‘.’ ‘ ’ 1
Residual standard error: on 3151 degrees of freedom
Multiple R-squared: , Adjusted R-squared:
F-statistic: on 2 and 3151 DF, p-value: < -16
整理ppt
M1 回归方程 :
sbp=+
M2 回归方程 :
sbp=+
M3 回归方程 :
sbp=++
整理ppt
par(mfrow=c(2,2), pch=19)
plot(M1,which=1)
plot(M1,which=2)
plot(M2,which=1)
plot(M2,which=2)
整理ppt
整理ppt
anova(M1,M3)
Analysis of Variance Table
Model 1: sbp ~ weight
Model 2: sbp ~ weight + age
RSS Df Sum of Sq F Pr(>F)
3152 674389
3151 652430 1 21958 < -16 ***
---
Signif. codes: 0 ‘***’ ‘**’ ‘*’ ‘.’ ‘
整理ppt
anova(M2,M3)
Analysis of Variance Table
Model 1: sbp ~ age
Model 2: sbp ~ weight + age
RSS Df Sum of Sq F Pr(>F)
3152 700808
3151 652430 1 48378 < -16 ***
---
Signif. codes: 0 ‘***’ ‘**’ ‘*’ ‘.’
整理ppt
confint(M1,level=)
% %
(Intercept)
weight
confint(M2,level=)
% %
(Intercept)
age
confint(M3,level=)
% %
(Intercept)
weight
age
整理ppt
(y和E(y))
new1=(weight=160)
=predict(M1,new1,
+interval="predi