[R] bootstrap sample with R
Dimitrios Rizopoulos
Dimitris.Rizopoulos at med.kuleuven.be
Sun Dec 10 10:01:07 CET 2006
you need ?sample(), e.g.,
x <- rnorm(9)
sample(x, replace = TRUE)
I hope it helps.
----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
http://www.student.kuleuven.be/~m0390867/dimitris.htm
Quoting Ethan Johnsons <ethan.johnsons at gmail.com>:
> How do you draw a bootstrap sample of size 9, with replacement, from
> the random dataset I drew? Is there a function for it in R?
>
> 9 random samples.
>
>> rnorm(9, 0, 1)
>
> [1] 1.2071538 0.3183367 -1.4237989 -0.4050909 0.9953866
> 0.9588178 0.9180879
> [8] -0.1509696 -1.2230688
>
>
> thx
>
> ej
>
> ______________________________________________
> 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.
>
>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
More information about the R-help
mailing list