class: center, middle, inverse, title-slide # Correlation test --- layout: true <div class="my-footer"> <span> </span> </div> --- --- class: middle # How would you define a correlation test? --- class: middle # Correlation tests associationđź’• --- class: middle # Correlation evaluates the __linear__ association between two or more variables. --- class: middle # How many methods to perform correlation analysis you know? --- ## Different methods to perform correlation analysis depending on data type <img src="img/pearson-correlation-spearman-correlation-linear-regression-6-638.png" width="50%" style="display: block; margin: auto;" /> --- ## Most widely used method is Pearson's <img src="img/pearson_blue.png" width="60%" style="display: block; margin: auto;" /> --- ## Example: comparing the correalation between two replicates of a gene expresion experiment These are two continues values and **might** followed a normal distribution. We need to check that the later is true. --- class: middle # Pearson correlation Pearson correlation (r) measures the linear dependence between two variables. r comes linear regression curve uppon plotting of y = f(x). To calculate r: <img src="img/correlation_coefficient_formula.jpg" width="40%" style="display: block; margin: auto;" /> And to calculate the significance associated to it. <img src="img/correlation_coefficient_formula_t.png" width="15%" style="display: block; margin: auto;" /> --- class: middle # Other correlation methods Ranking: Spearman & Kendall --- class: middle # Showing association To show association, variables are plotted as scatterplot <img src="img/scatter.png" width="40%" style="display: block; margin: auto;" /> --- # R functions for correlation - Base R - cor(iris$Sepal.Length, iris$Petal.Length, method = c("pearson"),na.rm = TRUE) - cor(iris$Sepal.Length, iris$Petal.Length, method = c("spearman")) + cor.test(iris$Sepal.Length, iris$Petal.Length,method=c("pearson")) - library(corrplot) corrplot(cor(iris[,1:4])) - library(Hmisc) rcorr(as.matrix(iris[,1:4])) --- class: middle # Let's dive in some proteomics data and explore correlation across replicates! ---