cor.by.class | R Documentation |
Finds within class correlations between samples of each class type, which is useful for identifying extreme observations and assessing whether CCM is appropriate for classification.
cor.by.class(x, y, method = "pearson", use = "complete")
x |
data matrix with variables in rows and samples in columns |
y |
classes corresponding to the columns of |
method |
the type of correlation to use, either 'pearson' (the default) or 'spearman' |
use |
instructions for handling missing values. See details and |
Calculates correlations between each pair of observations within each class. The correlation between an observation and itself is ignored.
The default correlation is the Pearson product moment correlation. If method
is 'spearman', then the Spearman's rank correlation is used, which is the Pearson correlation calculated using the ranks of the data.
Correlations are calculated class-wise on the matrix of observations of each class separately. Therefore, missing values may be handled differently for different classes.
A list with each element a vector of correlations between samples of a different class.
Garrett M. Dancik and Yuanbin Ru
data(data.expr) data(data.gender) K = cor.by.class(data.expr, data.gender) ## visualize the results ## boxplot(K, xlab = "gender")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.