[R] Stratified Bootstrap question
Qian An
qiana at biostat.umn.edu
Wed Mar 30 22:08:17 CEST 2005
Dear Tim,
Thank you so much for your help. My random mixed model is as follows:
b.lme <- lme(sbp ~ age + gender, data=bdat, random=~1/clinic/id,
na.action=na.omit)
When doing bootstrap with stratum clinic, a patient's data may appear
multiple times in the boostrap dataset and all of them share the same id.
I am wondering if the data from the same patient will cause problems in
lme fitting or not. Do you happen to know this or not?
I am really sorry for coming up more questions. Thank you so much for your
help.
Sincerely yours,
Qian
On 30 Mar 2005, Tim Hesterberg wrote:
> >Dear Tim,
> >
> >Thank you very much for your information. I will try to play with S+ as
> >you suggested. At the same time, I would like to share our idea with you
> >about the stratified bootstrapping for my scenario. I am not sure if it is
> >correct. I am playing with it now.
> >
> >We created a new dataset containing clinic and patient id within clinic,
> >then stratified boot() function was used to bootstrap
> >the newly-created dataset. Based on the indices of the bootstrap result,
> >since patient id is unique, we found the patient ids from the new dataset,
> >then found the corresponding dataset to fit a mixed model from the
> >original dataset using patient ids.
>
> That sounds reasonable. That is what the S+Resample library does
> internally.
>
> >I am trying to run the program now, but it takes longer than what I
> >expected. 500 times takes more than 3 hours and it is still running. I
> >will see if this is working properly.
>
> This may be normal. Fitting mixed models is iterative, unlike
> simple linear regression for which there is a closed-form solution.
> So running many replications can take a while.
>
> It might help if you specify starting values for the fixed-effects
> coefficients. Run the model for the original data, and extract
> the fixed-effects coefficients. Then specify those as starting
> values; this could make the bootstrap replicates run faster.
>
> >
> >Thank you very much for your input,
> >Qian
> >
> >
> >
> >On 30 Mar 2005, Tim Hesterberg wrote:
> >
> >> Dear Qian,
> >>
> >> You might try the S+Resample library, which has built-in support
> >> for both sampling by subject and stratified sampling.
> >>
> >> If you are a student, there is a free student version of S+.
> >>
> >> See
> >> www.insightful.com/downloads/libraries (S+Resample)
> >> www.insightful.com/Hesterberg/bootstrap (has link to the student version)
> >>
> >> For the missing values, consider the S+Missing library,
> >> which offers multiple imputation. With S+, do
> >> library(missing)
> >>
> >> Tim Hesterberg
> >>
> >> P.S. The combination of sampling by subject and stratified sampling
> >> was terribly messy to program. If I'd known in advance how messy, I
> >> never would have done it :-( But it is done now.
> >>
> >> >Dear R users,
> >> >
> >> >I have a question regarding stratified bootstrap question and how to implement
> >> >it using boot() in R's boot package.
> >> >
> >> >My dataset is a longitudinal dataset (3 measurements per person at year
> >> >1, 4 and 7) composed of multiple clinic centers and multiple participants
> >> >within each clinic. It has missing values.
> >> >
> >> >I want to do a bootstrap to find the standard errors and confidence
> >> >intervals for my variance components. My model is a mixed model with
> >> >random clinic and random participant within clinic.
> >> >
> >> >I thought two methods to do bootstrap:
> >> >(1) bootstrap data; however, I have problem specifying the second
> >> >parameter for my statistic function, shall I use indices, weight or
> >> >frequency and how shall I relate to my dataset.
> >> >(2) bootstrap residuals; however, the dataset has multiple measurements
> >> >and missing values. I am wondering how to construct a new data frame
> >> >containing the residuals and fitted values.
> >> >
> >> >Any ideas will be highly appreciated!
> >> >Sincerely yours,
> >> >Qian
> >>
> >> ========================================================
> >> | Tim Hesterberg Research Scientist |
> >> | timh at insightful.com Insightful Corp. |
> >> | (206)802-2319 1700 Westlake Ave. N, Suite 500 |
> >> | (206)283-8691 (fax) Seattle, WA 98109-3044, U.S.A. |
> >> | www.insightful.com/Hesterberg |
> >> ========================================================
> >> Download the S+Resample library from www.insightful.com/downloads/libraries
> >>
> >>
> >
> >***************************************
> >Qian An
> >Division of Biostatistics
> >University of Minnesota
> >(phone) 612-626-2263
> >(fax) 612-626-8892
> >Email: qiana at biostat.umn.edu
> >***************************************
> >
>
>
***************************************
Qian An
Division of Biostatistics
University of Minnesota
(phone) 612-626-2263
(fax) 612-626-8892
Email: qiana at biostat.umn.edu
More information about the R-help
mailing list