Description Usage Arguments Details Value See Also Examples
This function computes the correlation of each input variable in a dataframe with a given response variable and returns a dataframe listing the variables sorted in order of most to least correlated. NAs are removed from correlation computations, and only numeric variables are considered.
1 | get_top_corrs(dat, response_var, parallel = FALSE)
|
dat |
a tbl |
response_var |
character string containing the name of a variable in
|
parallel |
logical. If |
Use this technique for filtering out variables in the initial stages of data analysis, to get more familiar with how the individual input variables relate to the response variable of interest. Not recommended as a formal variable selection technique, since it will ignore interactions between inputs.
a tbl with two columns: var_name
gives the name of each
variable and correlation
gives its correlation with
response_var
.
Other descriptive: proc_freq
1 2 | x <- iris
get_top_corrs(x,"Petal.Length")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.