Description Usage Arguments Value See Also Examples
This function performs a correlation tests on a given dataset. Most notably; Pearson correlation and Spearman correlation. The dataset can be a mixture of data types. By default, the function performs the correlation tests on all numeric variables in the dataset. However, a y_index can be assigned whereby all correlation tests are perform in relation to a specified response variable in the dataset. The results of the correlation tests are returned as a data frame. This data frame can be exported as a .csv to a specified directory. The null hypothesis is that the correlation is equal to 0. Ho: cor(Xi) = 0, where i != j.
1 2 3 |
dataset |
The dataset on which the correlation tests are performed. |
y_index |
Integer value, the column index of the response variable, the default is NULL. |
y_name |
Character value, the column name of the response variable, the default is NULL. |
alternative |
The type of hypothesis being tested; two.sided, greater, less. The default is "two.sided". |
conf.level |
The level of confidence used in the tests, default is 0.95 |
file_name |
A character object indicating the file name when saving the data frame. The default is NULL. The name must include the .csv suffixs. |
directory |
A character object specifying the directory where the data frame is to be saved as a .csv file. |
Outputs the correlatiom test information as a data frame. This data frame can be saved as a .csv to a specified directory.
tests_chisq
, tests_ks
, tests_norm
, tests_proptest
, tests_t
, tests_var
, tests_wilcoxon
1 2 3 4 5 6 7 8 9 10 | #-- Example Lung Cap Data --#
# perform correlation tests on all pairs of numeric variables
tests_cors(dataset = lungcap)
# perform correlation tests on the 2nd column and all other numeric variables
tests_cors(dataset = lungcap, y_index = 2)
# perform correlation tests on Age and all other numeric varibales.
tests_cors(dataset = lungcap, y_name = 'Age')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.