统计建模与R软件第六章习题(共10页).doc
《统计建模与R软件第六章习题(共10页).doc》由会员分享,可在线阅读,更多相关《统计建模与R软件第六章习题(共10页).doc(10页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上第六章1 a x y plot(x,y)X与Y线性相关 b x y lm.sol summary(lm.sol)Call:lm(formula = y 1 + x)Residuals: Min 1Q Median 3Q Max -128.591 -70.978 -3.727 49.263 167.228 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 140.95 125.11 1.127 0.293 x 364.18 19.26 18.908 6.33e-08 *-Signif. codes
2、: 0 * 0.001 * 0.01 * 0.05 . 0.1 1 Residual standard error: 96.42 on 8 degrees of freedomMultiple R-Squared: 0.9781, Adjusted R-squared: 0.9754 F-statistic: 357.5 on 1 and 8 DF, p-value: 6.33e-08 回归方程为Y=140.95+364.18X,极为显著 d new lm.pred lm.pred fit lwr upr1, 2690.227 2454.971 2925.484Y(7)= 2690.227,
3、2454.971,2925.4842 out-data.frame(+ x1 - c(0.4,0.4,3.1,0.6,4.7,1.7,9.4,10.1,11.6,12.6,10.9,23.1,23.1,21.6,23.1,1.9,26.8,29.9),+ x2 - c(52,34,19,34,24,65,44,31,29,58,37,46,50,44,56,36,58,51),+ x3 - c(158,163,37,157,59,123,46,117,173,112,111,114,134,73,168,143,202,124),+ y lm.sol summary(lm.sol)Call:l
4、m(formula = y x1 + x2 + x3, data = out)Residuals: Min 1Q Median 3Q Max -27.575 -11.160 -2.799 11.574 48.808 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 44.9290 18.3408 2.450 0.02806 * x1 1.8033 0.5290 3.409 0.00424 *x2 -0.1337 0.4440 -0.301 0.76771 x3 0.1668 0.1141 1.462 0.16573 -S
5、ignif. codes: 0 * 0.001 * 0.01 * 0.05 . 0.1 1 Residual standard error: 19.93 on 14 degrees of freedomMultiple R-Squared: 0.551, Adjusted R-squared: 0.4547 F-statistic: 5.726 on 3 and 14 DF, p-value: 0. 回归方程为 y=44.9290+1.8033x1-0.1337x2+0.1668x3由计算结果可以得到,回归系数与回归方程的检验都是显著的3 a x y lm.sol summary(lm.sol
6、)Call:lm(formula = y 1 + x)Residuals: Min 1Q Median 3Q Max -9.84130 -2.33691 -0.02137 1.05921 17.83201 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) -1.4519 1.8353 -0.791 0.436 x 1.5578 0.2807 5.549 7.93e-06 *-Signif. codes: 0 * 0.001 * 0.01 * 0.05 . 0.1 1 Residual standard error: 5.
7、168 on 26 degrees of freedomMultiple R-Squared: 0.5422, Adjusted R-squared: 0.5246 F-statistic: 30.8 on 1 and 26 DF, p-value: 7.931e-06 线性回归方程为 y=-1.4519+1.5578x,并且未通过t检验和F检验 plot(x,y) abline(-1.4519,1.5578)c x y y.res-resid(lm.sol);y.fit plot(y.resy.fit) y.rst plot(y.rsty.fit)普通残差标准化残差d(4) lm.new p
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 统计 建模 软件 第六 习题 10
限制150内