{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HW3 - Sheet1 Page 1 a1=read.table"data3.1">...

This preview shows pages 1–2. 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: Sheet1 Page 1 a1=read.table("data3.1.txt") > data1=as.matrix(data1) > y=as.vector(data1) > x=rep(1:4,each=4) > g=lm(y~factor(x)) > summary(aov(g)) Df Sum Sq Mean Sq F value Pr(>F) factor(x) 3 191.5 63.833 9.1737 0.001976 ** Residuals 12 83.5 6.958 --- Signif. codes: 0 ¡¥***¡¦ 0.001 ¡¥**¡¦ 0.01 ¡¥*¡¦ 0.05 ¡¥.¡¦ 0. > g1=lm(y~x) > summary(aov(g1)) Df Sum Sq Mean Sq F value Pr(>F) x 1 0.8 0.800 0.0408 0.8427 Residuals 14 274.2 19.586 > x [1] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 > factor(x) [1] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 Levels: 1 2 3 4 plot(x,g\$res,xaxt="n",xlab="Diets",ylab="Residuals",main="Plot of residual vs factor levels",pch=16) mtext(paste("A"),side=1,at=1) mtext(paste("B"),side=1,at=2) mtext(paste("C"),side=1,at=3) mtext(paste("D"),side=1,at=4) qqnorm(g\$res,pch=20, main="Normal probability plot of residuals") # uneven data y=c(2.04,1.91,2.00,1.92,1.85,1.96,1.88,1.90,1.66,1.71,1.42,1.76,1.66,1.61,1.55,1.66,1.53,1.54,1.38,1.31,1.35,1.27,1.26,1.38, > trt=c(rep("175",8),rep("194",8),rep("213",8),rep("231",7),rep("250",6))...
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

HW3 - Sheet1 Page 1 a1=read.table"data3.1">...

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

View Full Document
Ask a homework question - tutors are online