slipforce=read.table("slipforce.txt",header=T) attach(slipforce) #plot main effects par(mfrow=c(2,4)) for(i in 1:8) boxplot(Force~slipforce[,i],main=paste("X",i)) par(mfrow=c(1,1)) #find effects - need to include the right number of terms (2^4 - 1) # note the interactions are highly confounded, see Table B.1-8, p.765 2*coef(lm(Force~X1+X2+X3+X4+X5+X6+X7+X8+X1:X2+X1:X3+X1:X4+X1:X5+X1:X6+X1:X7+ X1:X8)) #how can we tell which are significant? #assume most of the effects are zero and check the normal probability plot # (without the intercept) qqnorm(2*coef(lm(Force~X1+X2+X3+X4+X5+X6+X7+X8+X1:X2+X1:X3+X1:X4+X1:X5+X1:X6+ X1:X7+X1:X8))[2:16]) #this default line might not be as helpful in this case: qqline(2*coef(lm(Force~X1+X2+X3+X4+X5+X6+X7+X8+X1:X2+X1:X3+X1:X4+X1:X5+X1:X6+ X1:X7+X1:X8))[2:16]) sort(2*coef(lm(Force~X1+X2+X3+X4+X5+X6+X7+X8+X1:X2+X1:X3+X1:X4+X1:X5+X1:X6+ X1:X7+X1:X8))[2:16]) #here's a slightly better line qqnorm(2*coef(lm(Force~X1+X2+X3+X4+X5+X6+X7+X8+X1:X2+X1:X3+X1:X4+X1:X5+X1:X6+ X1:X7+X1:X8))[2:16]) abline(a=4.8,b=14.3)