hw5a - Solutions to Assignment 5 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 5 Stat 512, Spring 2010 1. (a) Define the factors as A: plant ( i = 1 , 2 , 3 , 4) and B: leaf ( j = 1 , 2 , 3). Factor B is nested within A. The linear model is Y ijk = + i + j ( i ) + ijk , where i N (0 , 2 ), + j ( i ) N (0 , 2 ), and ijk N (0 , 2 ). > # read in data, convert plant and leaf to factors > turnip <- read.table("Turnip.txt", header=T) > plant <- factor(turnip$plant) > contrasts(plant) <- contr.sum > leaf <- factor(turnip$leaf) > contrasts(leaf) <- contr.sum > calcium <- turnip$calcium > # fit nested model > result <- lm( calcium ~ plant/leaf ) > anova(result) Analysis of Variance Table Response: calcium Df Sum Sq Mean Sq F value Pr(>F) plant 3 7.5603 2.5201 378.727 3.805e-12 *** plant:leaf 8 2.6302 0.3288 49.409 5.090e-08 *** Residuals 12 0.0799 0.0067--- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 The expected mean squares are E (MS A ) = 2 + n 2 + nb 2 E (MS B ( A ) ) = 2 + n 2 E (MS Err ) = 2 so the MOM estimates are 2 = MS Err 2 = MS B ( A )- MS Err n 2 = MS A- MS B ( A ) nb > # extract MS and etimate variance components > tmp <- anova(result) > names(tmp) [1] "Df" "Sum Sq" "Mean Sq" "F value" "Pr(>F)" > MSA <- tmp$"Mean Sq"[1] > MSB.A <- tmp$"Mean Sq"[2] > MSE <- tmp$"Mean Sq"[3] > a <- 4 > b <- 3 > n <- 2 > # variance components: plants, leaves and error > sigma2.A<- (MSA - MSB.A) / (n*b) > sigma2.B <- (MSB.A - MSE) / n > sigma2 <- MSE > sigma2.A [1] 0.3652234 > sigma2.B [1] 0.1610604 > sigma2 [1] 0.006654167 The test for no plant effect H : 2 = 0 shown in the table is not correct, The correct test is based on F = MS A / MS B ( A ) . > # no plant effect > Fplant <- MSA/MSB.A > Fplant [1] 7.665167 > 1 - pf(Fplant, 3, 8) [1] 0.009725121 The test for no leaf effect H : 2 = 0 shown in the table is correct. It is based on F = MS B ( A ) / MS Err and is highly significant, (b) i. Correlation between measurements from the same leaf: Corr( Y ijk ,Y ijk ) = 2 + 2 2 + 2 + 2 > (sigma2.A + sigma2.B)/(sigma2.A + sigma2.B + sigma2) [1] 0.9875142 ii. Correlation between measurements from the same plant and different leaves: Corr( Y ijk ,Y ij k ) = 2 2 + 2 + 2 > sigma2.A /(sigma2.A + sigma2.B + sigma2) [1] 0.6853019 (c) To get an estimate and interval for the grand mean, note that the means for the plants...
View Full Document

Page1 / 8

hw5a - Solutions to Assignment 5 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