# # Epage 93 # # 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. # #----- library(alr3) data(fuel2001) attach(fuel2001) fuel <- fuel2001 Dlic <- 1000*fuel$Drivers/fuel$Pop Fuel <- 1000*fuel$FuelC/fuel$Pop Income <- fuel$Income/1000 logMiles <- logb(fuel$Miles,2) # use selects the variables of interest including Fuel m1 <- lm(formula = Fuel ~ Tax + Dlic + Income + logMiles, data = fuel) s1 <- summary(m1) print(s1,signif.stars=FALSE) betahat.boot <- boot.case(m1,B=999) summary(betahat.boot) apply(betahat.boot,2,sd) cl <- function(x) quantile(x,c(.025,.975)) apply(betahat.boot,2,cl)