Correlation in R
Overview
The following how-to guides explore how to conduct correlation analyses in R. Focus is placed on how to implement these analyses in R rather than providing a conceptual background. For an introductory background, I suggest Field, Miles, and Field’s 1st edition of “Discovering Statistics Using R”. The Field et al. text is an excellent introduction to many different types of statistical analyses and how to conduct them in R. I will also use sample datasets from the Field et al. text to demonstrate these analyses in R.
Requirements
- Working installation of RStudio & R
- Packages:
- tidyverse
- rstatix
- broom
- car
- QuantPsyc
Topics covered
Correlation in R Pt. 1 - Pearson Product Moment Correlations
In this guide, I will walk through how to use the rstatix package to perform Pearson product moment correlations in R. The Pearson correlation is used for cases where there are two continuous variables.
Correlation in R Pt. 2 - Comparing Correlation Coefficients
In this second part, we continue to examine the Exam Anxiety dataset to look at the separate correlations between the variables of interest in males and females. We then proceed to test if there is a difference between those two correlations.