> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Michael
> Sent: Thursday, April 20, 2006 3:50 AM
> To: [email protected]
> Subject: [R] Bootstrap error message: Error in
> statistic(data, original, ...) : unused argument(s) ( ...) [Broadcast]
>
>
> Dear colleagues,
>
> I've been swamped and fighting with error for a few hours but
> still desperately having absolutely no clue:
You really don't have to do that, but just RTFM instead. ?boot says:
statistic A function which when applied to data returns a vector
containing the statistic(s) of interest. [...]
In all other cases statistic must take at least two
arguments. The first argument passed will always be
the original data. The second will be a vector of
indices, frequencies or weights which define the
bootstrap sample. [...]
Your "myFun" clearly does not fit that description. boot() tried to call
"myFun" with a second argument, but "myFun" doesn't know what to do with a
second argument, and that's where you get the error.
Andy
> What's wrong with my bootstraping code?
>
> Thanks a lot!
>
> ------------------------
> Error Message:
>
> > bootResults=boot(X, myFun, R=10000);
> Error in statistic(data, original, ...) : unused argument(s) ( ...)
>
> ------------------------
> My code is:
>
> X=cbind(column_vector_1, column_vector_2);
> myFun=function(X)
> {
> return(mean(X[, 1])/var(X[, 2]));
> }
>
> bootResults=boot(X, myFun, R=10000);
>
> ---------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html