tests_cors: Performs Correlation Tests on a given dataset

Description Usage Arguments Value See Also Examples

Description

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.

Usage

1
2
3
tests_cors(dataset, y_index = NULL, y_name = NULL,
  alternative = c("two.sided", "greater", "less"), conf.level = 0.95,
  file_name = NULL, directory = NULL)

Arguments

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.

Value

Outputs the correlatiom test information as a data frame. This data frame can be saved as a .csv to a specified directory.

See Also

tests_chisq, tests_ks, tests_norm, tests_proptest, tests_t, tests_var, tests_wilcoxon

Examples

 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')

oislen/BuenaVista documentation built on May 16, 2019, 8:12 p.m.