# hw6 code - #1

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

Page 1 #1 dat=read.table("http://www.stat.ucla.edu/~hqxu/stat201A/data/solder.dat", h=F) #c subdat=dat[,6:9] subdat mat=matrix(c(subdat[,1],subdat[,2],subdat[,3],subdat[,4]), nrow=8, ncol=4, byrow=F) mat ybar=rep(0,8) for(i in 1:8){ ybar[i]= mean(mat[i,])} ybar s2=rep(0,8) for(i in 1:8){ s2[i]= var(mat[i,])} s2 attach(dat) A=V1 #mean response source("http://www.stat.ucla.edu/~hqxu/stat201A/R/halfnormal.R") # half normalif online g1=lm(ybar~ A+B+C+D+E) summary(g1) par(mfrow=c(1,1)) halfnormalplot(2*coef(g1)[-1], l=T, n=4) #only C is significant, A is significant at 15% g1=lm(ybar~ A+C+E, dat) summary(g1) #ybarhat=197.12-27.50A+56.87C #in order to decrease the soldiers defects, choose V1=A=+, and #V3=C=- 6.77 -0.8181 -0.7520 - 0.6874-0.7189 #variances g2=lm(log(s2)~ A+B+C+D+E) summary(g2) par(mfrow=c(1,1)) halfnormalplot(2*coef(g2)[-1], l=T, n=4) #none of them are very important g2=lm(log(s2)~ A+B+C+D+E) summary(g2) #all the points can be connect by a straight line. #d

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.

## This note was uploaded on 11/24/2010 for the course STAT 201a taught by Professor Wu during the Spring '10 term at Pasadena City College.

### Page1 / 4

hw6 code - #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