Dear S folks,
I occasionally use S plus with the menu and wonder if anyone's willing to
share a few lines of code to solve the following task, which is essentially
data management.
I have twenty imputed datasets because my original data had 20% missing
data which looks to be MAR using the ISNI index of Troxell et al. I want to
bootstrap the coefficients of a model that will be fit to each of the
twenty imputed datasets. The logical approach seems to be to bootstrap each
of the 20 datasets and then combine all the output and take the grand mean
and grand percentiles to construct the final bootstrap estimate and
confidence intervals.
The bootstrap command from the point and click menu works like this:
coef(lm(response~predictor, data.frame))
What I want to to do is run the bootstrap function for twenty different
data sets that are combined in one data file, and indexed with a variable
called _imputation_ = 1,2, ..., 20.
Any ideas in how I might code this in S plus?
Thanks in advance for your help.
Terrence E. Murphy, Ph.D.
Program on Aging
Yale University
1 Church St., 7th Floor
New Haven, CT 06437
terrence.murphy@yale.edu
phone: 203-764-9805
fax: 203-764-9831
|