### Bootstrap Regression Coefficients

### Example: The hormone data. Amount in milligrams of anti-inflammatory hormone

### remaining in 27 devices, after a certain number of hours of wear. The devices

### were sampled from 3 different manufacturing lots, called 1, 2, 3. Lot 3 looks

### like it had greater amounts of remaining hormone, but it also was worn the least

### number of hours.

x <- c(1,99,25.8,

1,152,20.5,

1,293,14.3,

1,155,23.2,

1,196,20.6,

1,53,31.1,

1,184,20.9,

1,171,20.9,

1,52,30.4,

2,376,16.3,

2,385,11.6,

2,402,11.8,

2,29,32.5,

2,76,32,

2,296,18,

2,151,24.1,

2,177,26.5,

2,209,25.8,

3,119,28.8,

3,188,22,

3,115,29.7,

3,88,28.9,

3,58,32.8,

3,49,32.5,

3,150,25.4,

3,107,31.7,

3,125,28.5)

H <- matrix(x, ncol=3, byrow=T) # create data matrix

# create the variables

lot <- H[,1]

hrs <- H[,2]

amount <- H[,3]

# plot the data ignoring lot

plot(amount,hrs)

# fit the linear model hrs = a + b*amount + e

hormone <- data.frame(hrs,amount)

H.lm <- lm(amount ~ hrs, hormone)

summary(H.lm)

# bootstrap the linear model

hormone.boot <- bootstrap(hormone, coef(lm(amount ~ hrs, hormone))

summary(hormone.boot)

plot(hormone.boot)

# Next, the jackknife after the bootstrap is used to assess the accuracy of the3 standard

# error estimates, and the influence of each observation on these estimates.

hormone.jack <- jack.after.bootstrap(hormone.boot,"SE")

hormone.jack

plot(hormone.jack)