[R] how to apply bootstrap with a grouping variable?

From: Alfonso Pérez <rfonsilei_at_hotmail.com>
Date: Thu, 27 Mar 2008 15:16:51 +0100

    Hello, my name is Alfonso. I'm trying to apply bootstrap to a database. This database present as variables: cohort, age, length, an group. The variable group is unique for each age*cohort, at this way, if we have 18 cohorts and we study individuals with an age between 2 and 10 years (9 diferent ages) then we will have 162 (9*18) diferent numbers in the variable named as group.

    I would like to apply bootstrap to this database but taken into account the variable group, at this way the resample would be carry out for each cohort*age.

    I've tried to do it with this sentence:

     boo <- bootstrap(subset.cod,cod.bootstr,nboot=5, strata=subset.cod$Groups,sim="ordinary")

    and also at this way:

     boo <- bootstrap(subset.cod,nboot=5,cod.bootstr,group=Groups)

     But I've obtained the beginning error message:

Error in FUN(newX[, i], ...) :
  unused argument(s) (strata = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2...

        Please, if someone knows something about this question, please let me know. All sugestions will be wellcome, thank you in advance.

                  Alfonso.





_________________________________________________________________
La vida de los famosos al desnudo en MSN Entretenimiento

        [[alternative HTML version deleted]]



R-help_at_r-project.org 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. Received on Thu 27 Mar 2008 - 14:22:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 27 Mar 2008 - 14:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive