correlate | R Documentation |
Correlate is a function that cestimates correlation between two variables, which can be either continuous, categorical (ordered factor) or censored (survival data).
correlate(X, Y, method = c("pearson", "spearman", "kendall", "frequency", "cramersv",
"cindex"),strata, weights, outX = TRUE, bootstrap_count = 0, alpha = 0.05,
alternative = c("two.sided", "less", "greater"))
X |
Vector of type numeric, ordered factor, or Surv. |
Y |
Vector of type numeric, ordered factor, or Surv of same length as |
method |
One of the following values: pearson, spearman, kendall, frequency, cramersv, or cindex. |
strata |
Vector of type factor corresponding to the sample strata. |
weights |
Vector of type numeric corresponding to the sample weights. |
outX |
For cindex, if set to |
bootstrap_count |
If set to |
alpha |
The probability of Type I error that is, rejecting a null hypothesis when it is in fact true |
alternative |
a character string specifying the alternative hypothesis,must be one of two.sided (default), greater or less. You can specify just the initial letter. |
The correlate
function could be used to measure correlation between any types of variables:
Pearson, Spearman, Kendall or concordance index
concordance index (Somers' Dxy)
concordance index (Somers' Dxy)
Carmer's V
concordance index (Somers' Dxy)
concordance index (Somers' Dxy)
Part of the code underlying correlate
is also used in mim
method of the mRMRe.Data
object because correlations are used to build the mutual information matrix in order for feature selection to take place. This is why these two functions have many argiuments in common.
estimate |
point estimate |
se |
standard error |
lower |
lower confidence bound |
upper |
upper confidence bound |
p |
p-value |
n |
sample size |
Nicolas De Jay, Simon Papillon-Cavanagh, Benjamin Haibe-Kains
mRMRe.Data-class
set.thread.count(2)
## load data
data(cgps)
## spearman correlation coefficent between the first gene and Camptothecin IC50
correlate(X=cgps.ge[ ,1], Y=cgps.ic50, method="spearman")
## concordance index between the first gene and Camptothecin IC50
correlate(X=cgps.ge[ ,1], Y=cgps.ic50, method="cindex")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.