分析的材料为对部分人的每天平均练习太极拳的小时数
> rt<-read.table("f:/x.txt",head=TRUE);rt
name age hour
1 刘光 56 2.5
2 张三 23 0.4
3 李四 32 0.7
4 王五 16 0.3
5 贺圆 78 0.9
6 方正 40 1.0
7 毕共完 65 1.8
> lm.sol<-lm(age~hour,data=rt)
> summary(lm.sol)
Call:
lm(formula = age ~ hour, data = rt)
Residuals:
1 2 3 4 5 6 7
-13.308 -9.154 -5.462 -14.385 37.000 -2.769 8.077
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 25.08 13.27 1.890 0.117
hour 17.69 10.12 1.748 0.141
Residual standard error: 19.7 on 5 degrees of freedom
Multiple R-squared: 0.3794, Adjusted R-squared: 0.2553
F-statistic: 3.057 on 1 and 5 DF, p-value: 0.1408
>