\documentclass[12pt]{report}
\usepackage{graphicx}
%\usepackage{psfrag}
\setlength{\textwidth}{6.3in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\pagestyle{empty}

\begin{document}

\centerline{\Large \bf 36-707 \ \ Homework \#7 \ \ Due Thursday Dec 6, 2001}
\bigskip

{\large\bf Reading}

We have been moving through material in RPD in approximately this
order:
\begin{itemize}
\item Bootstrap: not in RPD; but see e.g. pp. 142ff. in Venables and
  Ripley.
\item Logistic Regression: [not really in RPD]
\item Variable Selection: RPD, Ch 7.
\item Principal Components: RPD, Ch's 2, 13.
\item (Possibly) Biased Regression Methods: RPD, sect. 13.2
\end{itemize}
\bigskip

{\large\bf Exercises:}
\begin{enumerate}

\item {\em Random vs. fixed resampling in bootstrapping a regression}.
  Consider the {\tt Davis.dat} and {\tt 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.  
\begin{enumerate}
\item Bootstrap the regession using $r=1000$ bootstrap
  samples, in two ways:
\begin{itemize}
\item using random-X bootstrapping, that is, drawing whole
  observations $(y_i, x_{i1}, \ldots, x_{ik})$ in the bootstrap
  resampling;
\item using fixed-X bootstrapping, that is, drawing only the residuals
  $E_i = y_i - \hat y_i$ in the bootstrap resampling.
\end{itemize}
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?

{\em [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.]}

\item Randomly construct a new data set of 100 observations according
  to the regression model $y_i = 5 + 2x_i + \epsilon_i$, $\epsilon_i
  \sim 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?

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

\end{enumerate}

\item 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:
\begin{enumerate}
\item 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?
\item 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)?
\item Play with the {\tt step()} function (Splus, R) or preferably
  {\tt 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)).  
\item Perform a ``final'' logit regression using only the
predictors that were found to be significant in part (b).  Interpret these
coefficients.
\item Use the model in part (d) to determine the survival probability
(denote this as $\hat{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.
\item Construct line plots of the fitted survival probability vs age
  (for the model in part (d)), 
with the separate curves for 
\begin{itemize}
\item an emergency admit that is neither comatose nor in deep stupor
\item an elective admit that is neither comatose comatose nor in deep stupor
\end{itemize}
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).
\item Construct the standard Splus diagnostic plots for a {\tt glm}
  object and interepret (if possible!).  Are there any other plots
  that would be helpful in diagnosing the fit of the model?
\item Are there any other factors that you would include in this model?
If so, what are they?  If not, explain. 
\end{enumerate}


\end{enumerate}


\end{document}
















