[R] boot & boot.ci

2006-01-26 Thread Kuba
Dear all, I've a problem with bootstarp package... I want to bootstrap correlation ratio of some data. my code is: f<-function(d) cov(d$x,d$y)/sqrt(var(x)*var(y)) boot(d,f,R) As a result I got an error: Error in statistic(data, original, ...) : unused argument(s) (.. .) d is a

Re: [R] boot problem

2005-12-22 Thread Angelo Canty
What are you trying to do? boot does the resampling for you so you should pass the statistic that you want calculated on the resamples. Read the helpfile regarding the format of the statistic. It should take two arguments, one of which is a vector of indices specifying the resample. On Tue,

Re: [R] boot problem

2005-12-21 Thread Roger D. Peng
Your 'resample' function is not written according to the help page. Try resample <- function(x, index) { x[index, ] } -roger david v wrote: > Hello, > This is the code that is giving me problems > > >>library(boot) >>data<-read.table("test",header=FALSE,sep="\t",row.names=1) >>data > >

[R] boot problem

2005-12-20 Thread david v
Hello, This is the code that is giving me problems >library(boot) >data<-read.table("test",header=FALSE,sep="\t",row.names=1) >data V2 V3 V4 A 5 8 9 B 12 54 89 C 65 89 23 D 32 69 44 E 21 84 97 F 33 59 71 G 16 45 93 H2 46 55 I 22 33 88 >resample <- function(x,index) {

Re: [R] boot error: Error in statistic(data, original, ...) : unused argument(s) ( ...)

2005-08-15 Thread Thomas Lumley
On Sat, 13 Aug 2005, Prof Brian Ripley wrote: > I suspect you want > > AdjForBase2 <- function (data, inds) > > and to refer to data[inds, 1] and data[inds, 2], but since your code is > completely devoid of spaces and indentation, I have paid it little > attention. http://msr.uwaterloo.ca/msr2005/

Re: [R] boot error: Error in statistic(data, original, ...) : unused argument(s) ( ...)

2005-08-12 Thread Prof Brian Ripley
Please look at the examples and the book which package boot supports (see its DESCRIPTION file). From ?boot statistic: A function which when applied to data returns a vector containing the statistic(s) of interest. When 'sim="parametric"', the first argument to 'statistic'

[R] boot error: Error in statistic(data, original, ...) : unused argument(s) ( ...)

2005-08-12 Thread John Sorkin
I have added on additional line to the code below, the line the defines the matrix passed to AdjForBase2. I am having difficulty setting up a boot strap. My code is listed below. I am getting the following error message: Error in statistic(data, original, ...) : unused argument(s) ( ...) I neither

[R] boot error: Error in statistic(data, original, ...) : unused argument(s) ( ...)

2005-08-12 Thread John Sorkin
I am having difficulty setting up a boot strap. My code is listed below. I am getting the following error message: Error in statistic(data, original, ...) : unused argument(s) ( ...) I neither understand the error I have made that leads to the error message, nor do I know how to fix my error. Any

[R] boot function

2005-04-01 Thread Christina D Smith
The boot function documentation says, "The data as a vector, matrix or data frame. If it is a matrix or data frame then each row is considered as one multivariate observation". From trying several things, I've concluded that this means it resamples the rows but calculates the statistic on the col

Re: [R] boot package

2005-01-06 Thread Angelo Canty
Hi Nathan, sorry about the delay in responding. The test of whether all of the bootstrap values are equal is in the wrong place. I will correct it in the next release. Meanwhile, I think the simplest solution is to fix(boot.ci) and move the line if (const(t, min(1e-08, mean(t)/1e+06)))

[R] boot and variances of the bootstrap replicates of the variable of interest?

2005-01-04 Thread Dan Bolser
I want to use boot.ci to generate confidence intervals over the bootstrapped mean(s) of a group of observations (i.e. I have 10 observations and I want to know how confident I can be on the value for the mean). I don't know (or want to know) the details of bootstrapping - I just have the simplist

Re: [R] boot package

2004-12-05 Thread Ernesto Jardim
On Sun, 2004-12-05 at 01:37, Nathan Leon Pace, MD, MStat wrote: > Hi, > > I using the boot package 1.2-20 on R 2.0.1. > > My statistics function estimates 6 parameters. > > In a small percentage of resampled data sets my statistics function > doesn't produce an estimate for one parameter and th

Re: [R] boot package

2004-12-05 Thread Duncan Murdoch
On Sat, 4 Dec 2004 18:37:43 -0700, "Nathan Leon Pace, MD, MStat" <[EMAIL PROTECTED]> wrote: >Hi, > >I using the boot package 1.2-20 on R 2.0.1. > >My statistics function estimates 6 parameters. > >In a small percentage of resampled data sets my statistics function >doesn't produce an estimate for

[R] boot package

2004-12-04 Thread Nathan Leon Pace, MD, MStat
Hi, I using the boot package 1.2-20 on R 2.0.1. My statistics function estimates 6 parameters. In a small percentage of resampled data sets my statistics function doesn't produce an estimate for one parameter and the boot function stops with an error. I can write an ifelse(exists('parameter.esti

Re: [R] Boot package

2004-04-21 Thread Prof Brian Ripley
Some bootstrap resamples are giving infinite results for the first component of the statistic. That can certainly happen, given the censoring pattern. Here is one such bootstrap resample time cens group 2051 2 1781 2 1981 2 23 121 2 6131

[R] Boot package

2004-04-21 Thread Jingky Lozano
Dear mailing list, I tried to run the example for the conditional bootstap written in the help file of censboot. I got the following result: STRATIFIED CONDITIONAL BOOTSTRAP FOR CENSORED DATA Call: censboot(data = aml, statistic = aml.fun, R = 499, F.surv = aml.s1, G.surv = aml.s2, strata

Re: [R] boot question

2004-04-04 Thread Ajay Shah
> > x<-rnorm(20) > > mean(x) > [1] -0.2272851 > > results<-boot(x,mean,R=5) > > What in the world am I missing?? See http://www.mayin.org/ajayshah/KB/R/statistics.html -- Ajay Shah Consultant [EMAIL PROTECTED] Department of

Re: [R] boot question

2004-04-01 Thread Jason Turner
> What in the world am I missing?? stype. As in (from help(boot) stype: A character string indicating what the second argument of statistic represents. Possible values of stype are '"i"' (indices - the default), '"f"' (frequencies), or '"w"' (weights). This work

Re: [R] boot question

2004-04-01 Thread Angelo Canty
What you are missing is reading the helpfile! The function mean is not a valid statistic to be passed to boot function(x, i) mean(x[i]) is. Please do read the documentation. That's why it is provided. -- | Angelo J. Canty

Re: [R] boot question

2004-04-01 Thread Andrew Robinson
You have to let boot pass the index for selection to the function as well. So, for example, try: boot.mean <- function(data, index) mean(data[index]) results <- boot(x, boot.mean, R=5) Andrew. On Thursday 01 April 2004 14:19, Morris, Jeffrey [OCDUS] wrote: > What in the world am I mi

Re: [R] boot question

2004-04-01 Thread Achim Zeileis
always be the original data. The second will be a vector of indices, So I would think you want to do: R> mymean <- function(x, index) mean(x[index]) R> boot(x, mymean, R = 20) ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = x, statistic = mymean, R = 20)

[R] boot question

2004-04-01 Thread Morris, Jeffrey [OCDUS]
What in the world am I missing?? > x<-rnorm(20) > mean(x) [1] -0.2272851 > results<-boot(x,mean,R=5) > results[2] $t [,1] [1,] -0.2294562 [2,] -0.2294562 [3,] -0.2294562 [4,] -0.2294562 [5,] -0.2294562 Jeff Morris Ortho-Clinical Diagnostics A Johnson & Johnson Co. Rochester, NY Tel:

RE: [R] boot package

2004-03-08 Thread Hanke, Alex
Hi, The function anosim() in vegan package or sample() in base may be of help to you. Alex -Original Message- From: Rogério Rosa da Silva [mailto:[EMAIL PROTECTED] Sent: March 4, 2004 4:57 AM To: rhelp Subject: [R] boot package Dear all As part of an ongoing study on the

[R] boot package

2004-03-04 Thread Rogério Rosa da Silva
Dear all As part of an ongoing study on the ecomorphology of ant communities, I have obtained a matrix with 156 row (species) and 20 columns (several measurements of body shape) for 4 localities. For each community, I calculated a matrix of Euclidean distances between all pairs of species. Fr

[R] boot and sample question

2004-02-26 Thread s viswanath
I am new to R enviorns & greatly recommend the Venables Ripley "Modern Applied stats with S". I am interested in a sampling say 5 day continuous windows of stock returns from a population and not applying a function to it. Is this avaiable in the 'boot' or the 'sample' function, and if it is,

Re: [R] boot vs. bootstrap

2004-01-25 Thread Prof Brian Ripley
Package bootstrap is orphaned, that is no longer maintained. Package boot is much more comprehensive, and a recommended package. That suggests to me that you always use boot: I do. On Sun, 25 Jan 2004, Erin Hodgess wrote: > There is a library boot and another one bootstrap. > > When is it pre

[R] boot vs. bootstrap

2004-01-24 Thread Erin Hodgess
Dear R People: There is a library boot and another one bootstrap. When is it preferable to use one or the other, please? In particular, I was wondering about the function boot in the boot library and the function bootstrap in the bootstrap library. Those are the main bootstrap functions. R Ver

Re: [R] boot package question: sampling on factor, not row

2003-11-11 Thread Prof Brian Ripley
On Tue, 11 Nov 2003, Thomas W Blackwell wrote: > > > On Mon, 10 Nov 2003, Thomas W Blackwell wrote: > > > > > The second argument to boot(), called 'statistic', can be > > > any user-written function you want to cook up, with additional > > > arguments being passed to it through the '...' mecha

Re: [R] boot package question: sampling on factor, not row

2003-11-11 Thread Thomas W Blackwell
> On Mon, 10 Nov 2003, Thomas W Blackwell wrote: > > > The second argument to boot(), called 'statistic', can be > > any user-written function you want to cook up, with additional > > arguments being passed to it through the '...' mechanism after > > all of the named arguments. (See: `R-intro `

Re: [R] boot package question: sampling on factor, not row

2003-11-10 Thread Thomas W Blackwell
Scott - The second argument to boot(), called 'statistic', can be any user-written function you want to cook up, with additional arguments being passed to it through the '...' mechanism after all of the named arguments. (See: `R-intro `Writing your own functions `The ellipsis argument for det

[R] boot package question: sampling on factor, not row

2003-11-10 Thread Scott Norton
Hi all: I've been looking at the boot package to "bootstrap" sample my data in a particular way. I haven't figured out how to set this up using the boot() command and thus have resorted to trying to write my own script (although I'd prefer if I could get boot() to work for this problem!)

Re: [R] boot statictic fn for dual estimation of 2 stats?

2003-10-11 Thread Roger D. Peng
Occasionaly, the polr returns a zeta element of length equal to 2 rather than 3 (which I guess is what you're expecting). You're bootfn function should always check to see that it's returning an object of the same length every time. -roger Olivia Lau wrote: Hi, I am trying to use boot() to

[R] boot statictic fn for dual estimation of 2 stats?

2003-10-11 Thread Olivia Lau
Hi, I am trying to use boot() to refit an ordinal logit (polr in MASS) model. (A very basic bootstrap which samples from the data frame without replacement and updates the model.) I need to extract two statistics per run (the coefficients and zeta) and I tried concatenating them into a singl

[R] boot with strata doubt

2003-09-04 Thread Ernesto Jardim
Hi, I'm using the boot package to bootstrap a linear model. The boot command is: > blm01 <- boot(mat, boot.fishpower, 1000, strata=boot.strata) I'm having several problems with the linear model so I decided to check the stratification. The first thing I did was checking the number of observation

Re: [R] boot package

2003-09-03 Thread Roger D. Peng
It's hard to say, but I sometimes get this error when I either have a very small dataset or if I don't do enough resamples (i.e. R is too small). -roger Ernesto Jardim wrote: Hi, I'm getting this error that I don't understand can someone give an hint on this ? Thanks EJ boot.ci(blm01,type

[R] boot package

2003-09-03 Thread Ernesto Jardim
Hi, I'm getting this error that I don't understand can someone give an hint on this ? Thanks EJ > boot.ci(blm01,type="bca",index=4) Error in if (const(t, min(1e-08, mean(t)/1e+06))) { : missing value where TRUE/FALSE needed __ [EMAIL PROTECTE

Re: [R] Boot

2003-03-07 Thread John Fox
Dear Jacob, The appendix on bootstrapping to my R and S-PLUS Companion, available on the web at , discusses fixed-X resampling (which is what you're getting at here, I think) and includes an example. I hope that th

[R] Boot

2003-03-06 Thread Jacob van Wyk
Hallo Could anybody please help. I have a simple linear regression model with 5 predictors. I want to use "bootstrap residuals" to make inferences regarding beta(2)hat. After fitting the model y=b0+b1+b2+b3+b4+b5 I tried the following: mod <- lm(y ~ x1+x2+x3+x4+x5) res <- resid(mod) pred <- predic

[R] boot error message

2003-01-27 Thread Ernesto Jardim
Hi I'm using boot.ci to calculate the bca CI. However I'm getting an error message that I can not understand, can someone help me with this ? > blm8901.P1.bca <- boot.ci(blm8901,type=c("bca"),index=1) Error in if (!all(rk > 1 & rk < R)) warning("Extreme Order Statistics used as Endpoints") :