all_correlations {regclass} | R Documentation |
Pairwise correlations between quantitative variables
Description
This function gives a list of all pairwise correlations between quantitative variables in a dataframe. Alternatively, it can provide all pairwise correlations with just a particular variable.
Usage
all_correlations(X,type="pearson",interest=NA,sorted="none")
Arguments
X |
A data frame |
type |
Either |
interest |
If specified, returns only pairwise correlations with this variable. Argument should be in quotes and must give the exact name of the column of the variable of interest. |
sorted |
Either |
Details
This function filters out any non-numerical variables in the data frame and provides correlations only between quantitative variables. It is useful for quickly glancing at the size of the correlations between many pairs of variables or all correlations with a particular variable. Further analysis should be done on pairs of interest using associate
.
Note: if Spearmans' rank correlations are computed, warnings message result indicating that the exact p-value cannot be computed with ties. Running associate
will give you an approximate p-value using the permutation procedure.
Author(s)
Adam Petrie
References
Introduction to Regression and Modeling
See Also
Examples
#all pairwise (Pearson) correlations between all quantitative variables
data(STUDENT)
all_correlations(STUDENT)
#Spearman correlations between all quantitative variables and CollegeGPA, sorted by pvalue.
#Gives warnings due to ties
all_correlations(STUDENT,interest="CollegeGPA",type="spearman",sorted="significance")