11_06 - factor(A) 1 168.0 168.0 1.5667 0.222743 factor(B) 2...

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

View Full Document Right Arrow Icon
STAT 420 Examples for 11/06/2007 Fall 2007 Factor B Factor A 1 2 3 1 56 23 52 28 35 43 25 16 27 32 47 43 52 61 74 2 16 14 18 27 31 58 62 68 72 83 15 14 22 16 27 Means: Factor B Factor A 1 2 3 1 38.8 28.6 55.4 40.93333 2 21.2 68.6 18.8 36.2 30 48.6 37.1 38.56667
Background image of page 1

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

View Full DocumentRight Arrow Icon
> Y <- c(56, 23, 52, 28, 35, 43, 25, 16, 27, 32, 47, 43, 52, 61, 74, + 16, 14, 18, 27, 31, 58, 62, 68, 72, 83, 15, 14, 22, 16, 27) > A <- c( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) > B <- c( 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3) > results <- aov(glm(Y ~ factor(A) * factor(B))) > summary(results) Df Sum Sq Mean Sq F value Pr(>F)
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: factor(A) 1 168.0 168.0 1.5667 0.222743 factor(B) 2 1762.1 881.0 8.2148 0.001915 ** factor(A):factor(B) 2 7955.3 3977.6 37.0875 4.555e-08 *** Residuals 24 2574.0 107.2 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > # Cell means > tmp <- NULL > for(a in 1:2) + { + for(b in 1:3) + { + tmp <- c(tmp,mean(Y[A==a & B==b])) + } + } > means <- matrix(tmp,nrow=2,byrow=TRUE) > tmp [1] 38.8 28.6 55.4 21.2 68.6 18.8 > means [,1] [,2] [,3] [1,] 38.8 28.6 55.4 [2,] 21.2 68.6 18.8 > # for 2 plots on the same page > par(mfrow=c(1,2)) > > plot(Y~A,col=B,pch=B) > for(b in 1:3) + { + lines(1:2,means[,b],col=b) + } > > plot(Y~B,col=A,pch=A) > for(a in 1:2) + { + lines(1:3,means[a,],col=a) + }...
View Full Document

This note was uploaded on 04/29/2010 for the course STAT stat 420 taught by Professor Stepanov during the Spring '07 term at University of Illinois at Urbana–Champaign.

Page1 / 3

11_06 - factor(A) 1 168.0 168.0 1.5667 0.222743 factor(B) 2...

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