Displaying 1 result from an estimated 1 matches for "nummark".
Did you mean:
numark
2012 Jun 20
1
prcomp: where do sdev values come from?
...ions given by prcomp(). Can anyone
reconcile this example with the manual page for prcomp() or explain
how the standard deviations are calculated?
the code for standardize():
standardize<-function(data){
numSamples = nrow(data);
# calculate mean for each marker
mn=apply(data,2,mean);
numMarkers = ncol(data);
#standardize every entry
for(j in 1:numMarkers){
for(k in 1:numSamples){
temp = sqrt(mn[j]/2*(1-mn[j]/2));
data[k,j] = (data[k,j] - mn[j])/temp;
}
}
data;
}
Thank you,
Sky