



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Statistical Methods for Bioscience II; Subject: STATISTICS; University: University of Wisconsin - Madison; Term: Spring 2007;
Typology: Assignments
1 / 6
This page cannot be seen from the preview
Don't miss anything!




calib = read.table("calib.txt", header=T) str(calib) lm1 = lm(new~old, data=calib) summary(lm1) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.748 114.732 0.015 0. old 0.984 0.115 8.553 2.69e-05 ***
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1
Residual standard error: 169.5 on 8 degrees of freedom Multiple R-Squared: 0.9014, Adjusted R-squared: 0. F-statistic: 73.15 on 1 and 8 DF, p-value: 2.691e-
Part(b):
lm1b = lm(new~old-1, calib) ##fit a linear model with intercept summary(lm1b) Coefficients: Estimate Std. Error t value Pr(>|t|) old 0.98551 0.05067 19.45 1.16e-08 ***
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1
Residual standard error: 159.8 on 9 degrees of freedom Multiple R-Squared: 0.9768, Adjusted R-squared: 0. F-statistic: 378.3 on 1 and 9 DF, p-value: 1.161e-
sum(lm1a$resid) [1] -3.197442e- sum(lm1b$resid) [1] 3.
nitro 107.80 22.92 4.702 0.000109 *** phos 304.24 165.17 1.842 0.. potas 143.13 44.13 3.243 0.003731 **
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1
Residual standard error: 38.05 on 22 degrees of freedom Multiple R-Squared: 0.8602, Adjusted R-squared: 0. F-statistic: 45.14 on 3 and 22 DF, p-value: 1.435e-
Height = -217.82 + 114.75*nitro + 463.81 * phos + 100.33 * potas. All terms in this model are significant at the 0.05 level. The model plots seem better than previous model plots
larch1 = subset(larch, id != 7) ## subset without observation ID=7. lm22 = lm(height~., data=larch1) best.aic = step(lm22) summary(best.aic) best.bic = step(lm22, k=log(n)) summary(best.bic) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -217.82 31.92 -6.824 9.54e-07 *** nitro 114.75 19.87 5.774 9.89e-06 ***
phos 463.81 152.12 3.049 0.0061 ** potas 100.33 40.66 2.467 0.0223 *
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1
Residual standard error: 32.75 on 21 degrees of freedom Multiple R-Squared: 0.9008, Adjusted R-squared: 0. F-statistic: 63.56 on 3 and 21 DF, p-value: 1.049e-