Spearman
Correlation test
##
## Spearman's rank correlation rho
##
## data: data$met and data$exp
## S = 8, p-value = 0.3333
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -1
Plot - Correlation test
## Loading required package: ggplot2
## Loading required package: magrittr
p <- ggscatter(data,
x = "met",
y = "exp",
ylab = "log2(TPM + 1)",
font.label = c(4),
xlab = "DNA methylation",
add = "reg.line", # Add regression line
conf.int = FALSE, # Add confidence interval
add.params = list(color = "blue",
fill = "lightgray")
) + theme(legend.title = element_text(size=8),
legend.text = element_text(size=8),
legend.position="right",
plot.title = element_text(size=8,face="bold"))
p + stat_cor(method = "spearman")

Pearson
##
## Pearson's product-moment correlation
##
## data: data$met and data$exp
## t = -1.0884, df = 1, p-value = 0.4731
## alternative hypothesis: true correlation is not equal to 0
## sample estimates:
## cor
## -0.7363781
