hw2a - Solutions to Assignment 2 Stat 512, Spring 2010 1....

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solutions to Assignment 2 Stat 512, Spring 2010 1. (a) Here is R code to enter the data and fit the model. > gain <- c( + 4.1, 3.3, 3.1, 4.2, 3.6, 4.4, + 5.2, 4.8, 4.5, 6.8, 5.5, 6.2, + 6.3, 6.5, 7.2, 7.4, 7.8, 6.7, + 6.5, 6.8, 7.3, 7.5, 6.9, 7.0, + 9.5, 9.6, 9.2, 9.1, 9.8, 9.1) > > group <- rep(c(1,2,3,4,5), each=6 ) > group <- factor(group) > > result <- lm( gain ~ group ) > summary(result) Call: lm(formula = gain ~ group) Residuals: Min 1Q Median 3Q Max-1.0000 -0.2958 -0.0500 0.3917 1.3000 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.7833 0.2293 16.501 5.97e-15 *** group2 1.7167 0.3242 5.294 1.74e-05 *** group3 3.2000 0.3242 9.869 4.18e-10 *** group4 3.2167 0.3242 9.921 3.77e-10 *** group5 5.6000 0.3242 17.271 2.09e-15 ***--- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Residual standard error: 0.5616 on 25 degrees of freedom Multiple R-squared: 0.9289, Adjusted R-squared: 0.9175 F-statistic: 81.67 on 4 and 25 DF, p-value: 5.598e-14 The omnibus F-statistic (81.67 on 4 and 25 df) allows us to strongly reject the null hypothesis that all of the group means are equal. (b) The four contrasts are L 1 = 2- 1 L 2 = 3- 1 L 3 = 4- 1 L 4 = 5- 1 Placing the contrast weights into the rows of a matrix A = - 1 1 0 0 0- 1 0 1 0 0- 1 0 0 1 0- 1 0 0 0 1 and computing AA T = 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 , we see that these contrasts are not orthogonal. In the dummy-coding scheme used in part (a), these contrasts correspond to the coefficients labeled group2 , group3 , group4 , and group5 . All of them are highly significant at the .05 level. Using a Bonferroni adjustment, we can maintain a familywise error rate of .05 by splitting .05 into four equal parts, .05/4=.0125, and declaring a contrast significant if its p-value is less than .0125. All four of these are significant at that more stringent level. (c) The four contrasts are L 1 =- 1 + 2 + 3 + 4 + 5 4 L 2 =- 2 + 3 2 + 4 + 5 2 L 3 =- 2 + 3 L 4 =- 4 + 5 Placing the contrast weights into the rows of a matrix A = - 1 1 / 4 1 / 4 1 / 4 1 / 4- 1 / 2- 1 / 2 1 / 2 1 / 2- 1 1- 1 1 and computing AA T = 5 / 4 0 0 0 0 1 0 0 0 0 2 0 0 0 0 2 , we see that they are orthogonal. We can test these contrasts in R by computing each L and test statistic manually. But here is a trick that makes it easier. Suppose we append a row of equal weights 1/5 to...
View Full Document

This note was uploaded on 01/19/2012 for the course STAT 512 taught by Professor John during the Spring '11 term at Peru State.

Page1 / 6

hw2a - Solutions to Assignment 2 Stat 512, Spring 2010 1....

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online