Section 7.14 Key Functions & Commands
The following functions and commands are introduced or reinforced in this chapter to support correlation analysis and related exploratory techniques.
-
cor()(stats)-
Computes the Pearson correlation coefficient between two numeric variables.
-
-
cor.test()(stats)-
Calculates the correlation coefficient and tests whether the relationship is statistically significant.
-
-
pairs()(base R)-
Creates a matrix of scatterplots for exploring relationships among multiple numeric variables.
-
-
ggpairs()(GGally)-
Produces an enhanced scatterplot matrix that includes distributions and correlation coefficients.
-
-
pcor.test()(ppcor)-
Computes partial correlations while controlling for one or more additional variables.
-
-
ifelse()(base R)-
Recodes variables for use in point-biserial or conditional correlation analyses.
-
-
clean_names()(janitor)-
Renames column headers by replacing all spaces with underscores and making all letters lowercase.
-
