Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible Url : https://stat.ethz.ch/pipermail/r-help/attachments/20070515/799f44ed/attachment.pl
Frank E Harrell Jr
2007-May-15 15:56 UTC
[R] Re : Bootstrap sampling for repeated measures
justin bem wrote:> Hi, > > If it was me I would have done this > - First reshape the data frame to get some thing like > > header measure1 measure3 measure3 .... > 1280001 2.47 1.48 2.23 ... > > Since you have same number of measure for all subject. The you define you statistic with the data frame in this form. and you can use the boot function in boot or Hmisc bootstrap function. > > > Justin BEMI don't think that's the best way to go. As in the Design package (see the predab.resample, validate, calibrate functions) and the Hmisc rm.boot function you can easily sample from subject IDs and put together the needed records. Frank Harrell> El?ve Ing?nieur Statisticien Economiste > BP 294 Yaound?. > T?l (00237)9597295. > > ----- Message d'origine ---- > De : Niccol? Bassani <biostatistica at gmail.com> > ? : r-help at stat.math.ethz.ch > Envoy? le : Mardi, 15 Mai 2007, 11h15mn 51s > Objet : [R] Bootstrap sampling for repeated measures > > Dear R users, > I'm having some problems trying to create a routine for a bootstrap > resampling issue. Suppose I've got a dataset like this: > > Header inr ........ weeks ..... > 1280001 2.47 ........ 0 ....... > 1280001 1.48 ........ 1 ....... > 1280001 2.23 ......... 2 ...... > ........................ > ........................ > 1280369 2.5 ....... 56 ........ > > i.e. a dataset with n subjects identified by the column "header", with a set > of repeated mesaures. The amount of repeated measures for each subject is > 57, with a few of them being more or lesse frequent. That is, generalizing, > that I haven't got the same number of observations for each patient. > I've created a function allowing me to to reorder, subsetting and calculate > some statistics over this dataset, but now I need to bootstrap it all. I was > looking for a routine in R that could resample longitudinal data, in order > to resample "on the ID of the subjects". This means that while resampling > (suppose m samples of n length) I wish to consider (better with replacement) > either none or all of the observations related to a subject. > So, if my bootstrap 1st sample takes the patient with header 1280001, I want > the routine to consider all of the observations related with a subject with > such a header. > Thus, I shall obtain a bootstrap sample of my original dataset to wich apply > the function cited before (whose only argument is the dataset). > Can anybody help me? I'm trying to understand how the rm.boot function from > Hmisc package resamples this way, but it's not that easy, so if anyone could > help me I'd be very grateful. > Thanks in advance > Niccol? > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > > > > > > > > > ___________________________________________________________________________ > > > > > > [[alternative HTML version deleted]] > > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University