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.
[1] 1.4977661 0.1335859 0.0625366 0.2493484 -0.1225751 1.4977661
0.7537500
[8] 0.2493484 0.0625366
John
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC,
University of Maryland School of Medicine Claude D. Pepper OAIC,
University of Maryland Clinical Nutrition Research Unit, and
Baltimore VA Center Stroke of Excellence
University of Maryland School of Medicine
Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)
jsorkin at grecc.umaryland.edu
"Ethan Johnsons" <ethan.johnsons at gmail.com> 12/10/06 2:27 AM >>>
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.
Confidentiality Statement:
This email message, including any attachments, is for the so...{{dropped}}