[R] validate() in Design library

Frank E Harrell Jr f.harrell at vanderbilt.edu
Fri Jul 10 08:41:48 CEST 2009


array chip wrote:
> Hi, another question about validate() in Design library. The arugment "B" of this function is number of repetition for method="bootstrap", which is easy to understand; but for method="crossvalidation", B is the number of groups of omitted observations. This is confusing, I don't understand what it means. Let's say 5-fold cross validation, all samples are divided into 5 groups of equal number of samples, 4 groups will be used as training and the model developed there will be tested in the 1 group left-over. And the process circulate for all 5 groups. What does the "B" argument mean in this example? B=5? or B=1 because 1 group of samples omitted from model development?
> 
> Thanks
> 
> Yi
> 

Use B=5 to get 5-fold cross-validation.  But to get adequate precision 
you will need, depending on your overall sample size, to repeat this 100 
times and average the results over the 100 calls to validate().

Note that if you have done any feature or model selection using Y you 
will have to find a way to repeat the selection from the beginning for 
each resample.

Frank


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list