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 BEM Elève Ingénieur Statisticien Economiste BP 294 Yaoundé. Tél (00237)9597295. ----- Message d'origine ---- De : Niccolò Bassani <[EMAIL PROTECTED]> À : r-help@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@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@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.