pamr.cv {pamr}  R Documentation 
A function to crossvalidate the nearest shrunken centroid classifier produced by pamr.train
pamr.cv(fit, data, nfold = NULL, folds = NULL,...)
fit 
The result of a call to pamr.train 
data 
A list with at least two components: x an expression genes in the rows, samples in the columns), and y a vector of the class labels for each sample. Same form as data object used by pamr.train. 
nfold 
Number of crossvalidation folds. Default is the smallest class size 
folds 
A list with nfold components, each component a vector of indices of the samples in that fold. By default a (random) balanced crossvalidation is used 
... 
{Any additional arguments that are to be passed to pamr.train}
pamr.cv
carries out crossvalidation for a nearest shrunken
centroid classifier.
A list with components
threshold 

errors 
The number of crossvalidation errors for each threshold value 
loglik 
The crossvalidated multinomial loglikelihood value for each threshold value 
size 
A vector of the number of genes that survived the thresholding, for each threshold value tried. 
yhat 
A matrix of size n by nthreshold, containing the crossvalidated class predictions for each threshold value, in each column 
prob 
A matrix of size n by nthreshold, containing the crossvalidated class probabilities for each threshold value, in each column 
folds 
The crossvalidation folds used 
cv.objects 
Train objects (output of pamr.train), from each of the CV folds 
call 
The calling sequence used 
Trevor Hastie,Robert Tibshirani, Balasubramanian Narasimhan, and Gilbert Chu
set.seed(120) x < matrix(rnorm(1000*20),ncol=20) y < sample(c(1:4),size=20,replace=TRUE) mydata < list(x=x,y=factor(y), geneid=as.character(1:nrow(x)), genenames=paste("g",as.character(1:nrow(x)),sep=""),) mytrain < pamr.train(mydata) mycv < pamr.cv(mytrain,mydata)