Use
?sample
With replace On the number of rows, and then use them as indicators for
picking rows from the data set.

For example:

*sample(10, replace=T)*


Read more here:
http://www.ats.ucla.edu/stat/R/library/bootstrap.htm



----------------------------------------------


My contact information:
Tal Galili
E-mail: tal.gal...@gmail.com
Phone number: 972-52-7275845
FaceBook: Tal Galili
My Blogs:
http://www.talgalili.com (Web and general, Hebrew)
http://www.biostatistics.co.il (Statistics, Hebrew)
http://www.r-statistics.com/ (Statistics,R, English)




On Thu, Nov 19, 2009 at 9:40 AM, ke fang <fang.c...@yahoo.com.cn> wrote:

> Dear all.
>  I have a data matrix that each row containing a specific individual's
> information  including individual observation and  properties. I'm trying to
> use R to create some bootstrap samples with this data matrix. I have tried
> the boot() function in boot package, but it seems that this function need
> one or more statistic to be summarized. I can't just get my data resampled.
> I also tried the resample() function but get nothing. Can some body give me
> some hint on solving this problem?
>  Thanks in advance!
>  Here is some of my data. Rows represent individual. Columns represent
> individual information and observation.
>
> 10 168 133 22.5 1 0 3.45 4.890349
> 11 672 15 25.5 1 0 3.9 2.70805
> 12 168 201 25.7 1 0 3.9 5.303305
> 17 216 125 46.5 0 0 4.7 4.828314
> 18 216 103 95 0 0 9.5 4.634729
> 19 504 92 64 0 0 7 4.521789
> 20 504 52 81.5 0 0 8.2 3.951244
>
>
>      ___________________________________________________________
>  ºÃÍæºØ¿¨µÈÄã·¢£¬ÓÊÏäºØ¿¨È«ÐÂÉÏÏߣ¡
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help@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.
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to