Re: [R] Using function 'boot on a bi-polar sample'

From: Prof Brian Ripley <>
Date: Tue 10 May 2005 - 16:00:07 EST

On Tue, 10 May 2005, Briggs, Meredith M wrote:

> I'm not sure I'm using boot correctly:

You are not using argument `i'. Have you read the reference: `boot' is support software for a book? (Or even the definition of `statistic' on the help page?) The bootstrap sample in your case is x[i], not x.

> I have a list of values for a variable in BUCKET[, j] I want to use
> function 'boot' to estimate a confidence interval on the mean of the
> non-zero data. The data can be bi-polar or skewed. Is this the correct
> use of boot to establish a mean and standard deviation or median and
> percentiles?
> x<-BUCKET[, j]
><-function(x,i) {mean(x[x>0])}
><-function(x,i) {median(x[x>0])}
> print(
> print(
> B.mean<-boot(x,,R=999)
> B.median<-boot(x,,R=999)
> print(B.mean)
> print(B.median)
> I need the 'boot' function to sample repeatedly from the density
> distribution of the raw data and calculate means, medians etc.
> How do I pull out the mean, median, deviations and percentiles into
> variables within R?

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Tue May 10 16:06:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:40 EST