# # Epage 266 # # 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. # #----- if(is.null(version$language) == FALSE){ require(alr3) }else{ library(alr3) } if(is.null(version$language) == FALSE) data(banknote) banknote = na.omit(banknote) attach(banknote) postscript("../../WriteUp/Graphics/Chapter12/prob_5_scatterplotmatrix.eps", onefile=FALSE, horizontal=FALSE) pairs( ~Length+Left+Right+Bottom+Top+Diagonal+ Y ) dev.off() YF = factor( Y, ordered=FALSE ) postscript("../../WriteUp/Graphics/Chapter12/prob_5_scatterplotmatrix.eps", onefile=FALSE, horizontal=FALSE) scatterplot.matrix( banknote, groups=YF ) dev.off() # try all terms ... this is a poor result m0 = glm( Y~Length+Left+Right+Bottom+Top+Diagonal, family=binomial(), data=banknote ) s0 = summary(m0) s0 # try just a single predictor ... this is much better m0 = glm( Y~Diagonal, family=binomial(), data=banknote ) summary(m0) # update to find more features #m1 = update(m0,~.+