# This program produces the output and tables for # Body Fat Example, NKNW 4th ed Table 7.1 # Objective: # 1. Compute and Interprete Extra Sum of Squares # 2. Decomposition of SSR in ANOVA # Created by C. Andy Tsao. 060508 t<-matrix(scan("CH07TA01.DAT"),ncol=4,byrow=T) dt<-data.frame(x1=t[,1],x2=t[,2],x3=t[,3],y=t[,4]) attach(dt) # Default dt data.frame m123<-lm(y~x1+x2+x3); summary(m123); anova(m123); m1<-lm(y~x1); summary(m1); m12<-lm(y~x1+x2); summary(m12); anova(m12); m21<-lm(y~x2+x1); summary(m21); anova(m21); m132<-lm(y~x1+x3+x2); summary(m132); anova(m132); # Pay attention to the identity t^2 = F