{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW4 - > data4=read.table"data4.1 > data4=data.frame(data4 >...

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

Sheet1 Page 1 > data4=read.table("data4.1.txt") > data4=data.frame(data4) > data4 # # Vector the x ==> V1, define y, and build the linear model # >x = factor ( data4\$V1) >y = data4\$V2 >g = lm(y~x) > # # call the ANOVA table # >summary(aov(g)) Df Sum Sq Mean Sq F value Pr(>F) x 5 42.940 8.5879 10.388 3.152e-08 *** Residuals 114 94.248 0.8267 # #Residual vs.factor levels # plot(data4\$V1,g\$res,xaxt="n",xlab="Cuckoo",ylab="Residual",main="Plot of residual vs factor levels",col="green",pch=16) # #Label # > mtext(paste("MDWP"),side=1,at=1) > mtext(paste("TRP"),side=1,at=2) > mtext(paste("HGSPRW"),side=1,at=3) > mtext(paste("RBN"),side=1,at=4) > mtext(paste("PWGTL"),side=1,at=5) > mtext(paste("WREN"),side=1,at=6) # #Boxplot #Color > plot(x,g\$res,,xaxt="n",xlab="Cuckoo",ylab="Residual", + main="Plot of residual vs factor levels", + col=c("red","green","blue","69","deeppink","yellow"),pch=16) > mtext(paste("MDWP"),side=1,at=1) > mtext(paste("TRP"),side=1,at=2) > mtext(paste("HGSPRW"),side=1,at=3) > mtext(paste("RBN"),side=1,at=4)

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

View Full Document
Sheet1 Page 2 > mtext(paste("PWGTL"),side=1,at=5) > mtext(paste("WREN"),side=1,at=6) # #Question 2 # > paint=read.table("data4.2.txt") > paint=as.matrix(paint) > y=as.vector(paint) > bl=rep(1:6,times=4) > trt=rep(1:4,each=6) > g=lm(y~factor(trt)+factor(bl)) > summary(aov(g)) Df Sum Sq Mean Sq F value Pr(>F)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

HW4 - > data4=read.table"data4.1 > data4=data.frame(data4 >...

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

View Full Document
Ask a homework question - tutors are online