36-707 Homework #7 Due Thursday Dec 6, 2001

Reading

We have been moving through material in RPD in approximately this order:

• Bootstrap: not in RPD; but see e.g. pp. 142ff. in Venables and Ripley.

• Logistic Regression: [not really in RPD]

• Variable Selection: RPD, Ch 7.

• Principal Components: RPD, Ch’s 2, 13.

• (Possibly) Biased Regression Methods: RPD, sect. 13.2

Exercises:

1. Random vs. fixed resampling in bootstrapping a regression. Consider the Davis.dat and Davis.cbk files containing a data set on measured anbd reported weights for 200 men and women encaged in regular exercise. Extract the subset of the data for women, and perform a least squares regression of reported weight on measured weight.

(a) Bootstrap the regession using r = 1000 bootstrap samples, in two ways:

• using random-X bootstrapping, that is, drawing whole observations (y_{i}, x_{i1}, …, x_{ik}) in the bootstrap resampling;

• using fixed-X bootstrapping, that is, drawing only the residuals E_{i} = y_{i}−ŷ_{i}

in the bootstrap resampling. In each case, plot a histogram (and density estimate, if you wish) of the 1000 bootstrap slopes, and calculate the bootstrap estimate of standard error for the slope. How does the influential outlier in this data set affect random-X resampling? How does it affect fixed-X resampling? [Note: You should be able to imitate what I did in the handout for bootstrapping. Hopefully there won’t be any non-full-rank problems when you do random-X resampling. Alternatively, explore the bootstrap functions built into Splus and the MASS library, and documented in Venables and Ripley.]

(b) Randomly construct a new data set of 100 observations according to the regression model y_{i} = 5 + 2x_{i} + ϵ_{i}, ϵ_{i} ∼ N(0, X_{i}^{2}) [normal errors but seriously non-constant variance!]. Bootstrap the regression using both (i) random-X resampling and (ii) fixed-X resampling. In each case, plot a histogram (and density estimate, if you wish) of the 1000 bootstrap slopes, and calculate the bootstrap estimate of standard error for the slope. Compare the results for random-X and fixed-X resampling. For a few of the bootstrap samples, plot the least-squares residuals against the fitted values (usual residual plots). How do the plots differ, for fixed-X vs random-X resampling?

(c) Why might random-X resampling be preferred in these contexts, even if (as is not the case for the Davis data) the X values are best conceived of as fixed by the data collection design?

2. Refer to the dataset and problem outlined at http://lib.stat.cmu.edu/DASL/Datafiles/ICU.html. Download the data and use S-plus to:

(a) Perform a logistic regression of vital status on the following predictors: AGE, SER, CRN, INF, CPR, SYS, TYP, PO2, CRE, LOC. Which predictors appear significant?

(b) Compare your results from (a) with the smaller model considering AGE, SYS, TYP, LOC. Are these predictors significant? How does this model compare with the model in part (a)?

(c) Play with the step() function (Splus, R) or preferably stepAIC() (library(MASS) of Venables and Ripley) to try to automatically select variables for the model. Report your results (if you couldn’t make it work, report that; if you could make it work, list the models tried and compare the final model to the model in part (b)).

(d) Perform a “final” logit regression using only the predictors that were found to be significant in part (b). Interpret these coefficients.

(e) Use the model in part (d) to determine the survival probability (denote this as P̂) of a patient who is an emergency admit in a deep stupor, age 73. (If your part (d) model still includes SYS, use the sample mean of SYS in the data). Hint: Think about what “survival” means in relation to the 0-1 representation for STA listed on website.

(f) Construct line plots of the fitted survival probability vs age (for the model in part (d)), with the separate curves for

• an emergency admit that is neither comatose nor in deep stupor

• an elective admit that is neither comatose comatose nor in deep stupor

Label the curves and interpret your results. (If your part (d) model art (d) model still includes SYS, use the sample mean of SYS in the data).

(g) Construct the standard Splus diagnostic plots for a glm object and interepret (if possible!). Are there any other plots that would be helpful in diagnosing the fit of the model?

(h) Are there any other factors that you would include in this model? If so, what are they? If not, explain.