Description Usage Arguments Details Author(s) References See Also Examples

View source: R/all_correlations.R

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.

1 | ```
all_correlations(X,type="pearson",interest=NA,sorted="none")
``` |

`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 |

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.

Adam Petrie

Introduction to Regression and Modeling

1 2 3 4 5 6 7 | ```
#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")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.