HW8 - -0.5 split.screen(c(1,2,3)) screen(1)...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 #Question 1 # OT=c(-1,-1,-1,-1,1,1,1,1) PC=c(-1,-1,1,1,-1,-1,1,1) ST=c(-1,1,-1,1,-1,1,-1,1) y=c(67,79,61,75,59,90,52,87) g=lm(y~ OT+PC+ST+OT:PC+OT:ST+PC:ST+OT:PC:ST) eff=2*g$coef[-1] eff round(cbind(eff),3) eff OT 1.5 PC -5.0 ST 23.0 OT:PC 0.0 OT:ST 10.0 PC:ST 1.5 OT:PC:ST 0.5 split.screen(c(1,2)) [1] 1 2 screen(1) interaction.plot(OT,ST,y) screen(2) interaction.plot(ST,OT,y) # #Half normal plot halfnorm = function(x) ## This function generates the half normal plot { n = length(x) halfn = .5+.5*(1:n-.5)/n plot(qnorm(halfn), sort(abs(x)), type="p", pch=20, xlab="half-normal quantiles", ylab="absolute effects") identify(qnorm(halfn), sort(abs(x)), names(sort(abs(x)))) } halfnorm(eff) # #Question 2 A=c(-1,1,-1,1,-1,1,-1,1) B=c(-1,-1,1,1,-1,-1,1,1) C=c(-1,-1,-1,-1,1,1,1,1) y=c(60,62,82,86,85,85,61,61)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Sheet1 Page 2 g=lm(y~A+B+C+A:B+A:C+B:C+A:B:C) eff=2*g$coef[-1] eff A B C A:B A:C B:C A:B:C 1.5 -0.5 0.5 0.5 -1.5 -23.5
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: -0.5 split.screen(c(1,2,3)) screen(1) interaction.plot(A,B,y) screen(2) interaction.plot(A,C,y) # #Half normal plot halfnorm = function(x) ## This function generates the half normal plot { n = length(x) halfn = .5+.5*(1:n-.5)/n plot(qnorm(halfn), sort(abs(x)), type="p", pch=20, xlab="half-normal quantiles", ylab="absolute effects") identify(qnorm(halfn), sort(abs(x)), names(sort(abs(x)))) } halfnorm(eff) # #Question 3 # A=c(-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1) B=c(-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1,1,1,1,1) C=c(-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1) D=c(1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1) z=c(-1.309,-1.234,-1.317,-1.625,-1.510,-1.585,-1.505,-1.537,-1.313,-1.302,-1.514,-1.474,-1.483,-1.374,-1.386,-1.650) g=lm(z~ A+B+C+D+A:B+A:C+A:D+B:C+B:D+C:D+A:B:C+A:B:D+A:C:D+B:C:D+A:B:C:D) eff=2*g$coef[-1] eff round(cbind(eff),3)...
View Full Document

This note was uploaded on 06/06/2011 for the course STAT 4220 taught by Professor Smith during the Spring '08 term at UGA.

Page1 / 2

HW8 - -0.5 split.screen(c(1,2,3)) screen(1)...

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

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