# hw5a - Solutions to Assignment 5 Stat 512 Spring 2010 1(a...

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

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

View Full Document
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(a...

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

View Full Document
Ask a homework question - tutors are online