Skip to content
Back to formatted view

Raw Message

Message-ID: <d4844ab41001090936q7f1b1d7cm2494942229254b2d@mail.gmail.com>
Date: 2010-01-09T17:36:43Z
From: Amit
Subject: bootstrapping a matrix using boot package

Dear All,
I am trying to bootstrap a large data matrix 'exp' of dimension
9275x898 using package 'boot'. I am trying to calculate correlation of
the obtained samples. I have done following so far:

>library(boot)
>load("ratio_exp.RData") #loading the data matrix
>dim(ratio_exp)
[1] 9275  898
>sample.cor=function(ratio_exp,d){return(cor(t(ratio_exp[d,])))} #function for obtaing correlation
>boot.exp=boot(ratio_exp,sample.cor,R=50)
Error in matrix(NA, sum(R), lt0) : too many elements specified

But when I reduced the no of replication that is 10 then I got following
>boot.exp=boot(ratio_exp,sample.cor,R=10)
> str(boot.exp$t)
 num [1:5, 1:86025625] 1 1 1 1 1 ...

In both the cases its not correct. So I am doing something wrong in
writing the function sample.cor. Please help!

regards
Amit