[R] help with bootstrap

Warnes, Gregory R gregory_r_warnes at groton.pfizer.com
Tue Sep 24 21:41:05 CEST 2002


If you read the boot help page, you will note that you need to use a wrapper
function:
 
      boot.var.eig <- function( x, ind)   var.eigenvalues(x[ind])
 
Then 
 
    boot(matrix, boot.var.eig, 100) 
 
should do the trick.
 
-Greg


 
 -----Original Message-----
From: Marcio Pie [mailto:pie at bu.edu]
Sent: Tuesday, September 24, 2002 8:04 AM
To: r-help at stat.math.ethz.ch
Subject: [R] help with bootstrap



Hi there, 


I'm stuck, but since I just started learning R, this might be a trivial
problem. I need to do a bootstrap on the variance among the eigenvalues of a
matrix. I can get this variance doing this: 


>var.eigenvalues=function(x) 

>var(eigen(cov(x), symmetric = T, only.values = T)$values) 



but if I try to run: 

>matrix=read.table("matrix.txt", header=T) 

>boot(matrix, var.eigenvalues, 100) 


I get: "Error in statistic(data, original, ...) : unused argument(s) (
...)". 


Any idea of what I might be doing wrong? 


Any help with be really appreciated. 


Marcio 


p.s.: Since I'm not subscribed, please reply to my e-mail address:
pie at bu.edu.spam (don't forget to remove the .spam from the address).



LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list