[R] Stratified Bootstrap question
Tim Hesterberg
timh at insightful.com
Fri Apr 1 04:55:42 CEST 2005
Dear Qian,
Yes, when bootstrap sampling by subject, when a subject is included
in a bootstrap dataset multiple times, you must give that subject
different IDs, or some statistics would be incorrect.
Here's what S+Resample does (from help(bootstrap.args)):
If subject is the name of a variable in the data frame (for
example data=Orthodont, subject=Subject), then bootstrap makes
resampled subjects unique; that is, duplicated subjects in a
given resample are assigned distinct subject values in the
resampled data frame before the statistic is evaluated; this is
useful for longitudinal and other modeling where the statistic
expects subjects to have unique values.
Tim Hesterberg
>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?
>
>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
More information about the R-help
mailing list