Re: [R] Bootstrap Confidence Intervals

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sun, 30 Dec 2007 20:09:38 +0000 (GMT)

You need to call boot() to create an object to pass to boot.ci().

There are lots of examples in the help pages and in the book that package 'boot' supports. From the help:

Usage:

      boot.ci(boot.out, conf = 0.95, type = "all",
              index = 1:min(2,length(boot.out$t0)), var.t0 = NULL,
              var.t = NULL, t0 = NULL, t = NULL, L = NULL, h = function(t) t,
              hdot = function(t) rep(1,length(t)), hinv = function(t) t, ...)

Arguments:

boot.out: An object of class '"boot"' containing the output of a

           bootstrap calculation.

and try class(z) .

On Sun, 30 Dec 2007, _Fede_ wrote:

>
>
> Hi all.
>
> This is my first post in this forum. Finally I find a forum in the web about
> R, although is not in my language.
>
> Now I'm working with Bootstrap CI. I'd like to know how I can calculate a
> Bootstrap CI for any statistic, in particular, for Kurtosis Coeficient. I
> have done the following code lines:
>
>> library(boot)
>> x=rnorm(20)
>> kurtosis=function(x) (mean((x-mean(x))^4))/(sd(x)^4)
>> z <- numeric(10000)
>> for(i in 1:10000)
>> z[i]=kurtosis(sample(x, replace=TRUE))
>> boot.ci(z, conf = 0.95,type = c("norm","basic","perc","bca"))
>
> But the output shows the next error:
>
> Error en if (ncol(boot.out$t) < max(index)) { :
> argumento tiene longitud cero
>
> I don't know what is wrong.
>
> I hope that somebody can help me. Sorry for my english.
>
> All have a nice new year.
>
> _Fede_
>
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
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 Sun 30 Dec 2007 - 20:12:15 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 Sun 30 Dec 2007 - 22:30:20 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.