# # Epage 137 # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- # version$language == "R" for R version$language == NULL for SPlus if(is.null(version$language) == FALSE){ require(alr3) }else{ library(alr3) } data(BGSall) attach(BGSall) # create a factor based on sex: D = factor( BGSall$Sex, ordered=FALSE ) # fit the two models of interest: # m0 <- lm(HT18 ~ HT2 + HT9 + D , na.action=na.omit) # this is the null hypotheis m1 <- lm(HT18 ~ HT2 + HT9 + D + D:HT2 + D:HT9, na.action=na.omit) # this is the alternative hypothsis anova(m0,m1)