Description Usage Arguments Examples
This function returns the value of the correlation between two variables and its corresponding p-value for four types of coefficients; Pearson correlation (r), Maximum information coefficient (MIC); Random dependency coefficient (RDC) and Correlation of distances (dCor).
1 |
x |
A numeric vector |
y |
A numeric vector of the same dimension as |
type |
Specifies the type of correlations to compute. "Pearson" for the Pearson Correlation, "MIC" for the Maximum Information Coefficient, "RDC" for the Random Dependency Coefficient and finally "dCor" for the Correlation of Distances. |
R |
Number of permutations to be made for MIC and dCor to calculate the p-values |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #Lineal dependence
x<-rnorm(200, sd=2.5)
y<-2*x+rnorm(200, sd=2.5)
AlterCorr(x, y, type="pearson")
AlterCorr(x, y, type="MIC",R=10)
AlterCorr(x, y, type="RDC")
AlterCorr(x, y, type="dCor",R=100)
#No dependency
x<-rnorm(200, mean=2, sd =1.8)
y<-rnorm(200, mean=0, sd =2.5)
AlterCorr(x, y, type="pearson")
AlterCorr(x, y, type="MIC",R=10)
AlterCorr(x, y, type="RDC")
AlterCorr(x, y, type="dCor",R=100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.