CCassociation {analyzer}R Documentation

Association (Correlation) between Continuous (numeric) Variables

Description

CCassociation finds correlation between all the variables in data with only numeric columns

Usage

CCassociation(
  numtb,
  use = "everything",
  normality_test_method,
  normality_test_pval,
  method1 = c("auto", "pearson", "kendall", "spearman"),
  methodMat1 = NULL,
  methods_used
)

Arguments

numtb

a data frame with all the numerical columns. This should have at least two columns

use

an optional character string giving a method for computing association in the presence of missing values. This must be (complete or an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs". If use is "everything", NAs will propagate conceptually, i.e., a resulting value will be NA whenever one of its contributing observations is NA. If use is "all.obs", then the presence of missing observations will produce an error. If use is "complete.obs" then missing values are handled by case wise deletion (and if there are no complete cases, that gives an error). "na.or.complete" is the same unless there are no complete cases, that gives NA

normality_test_method

method for normality test for a variable. Values can be shapiro for Shapiro-Wilk test or 'anderson' for 'Anderson-Darling' test of normality or ks for 'Kolmogorov-Smirnov'

normality_test_pval

significance level for normality tests. Default is 0.05

method1

method for association between continuous-continuous variables. values can be "auto", "pearson", "kendall", "spearman". See details for more information.

methodMat1

method dataframe like methodMats from the function association

methods_used

a square data.frame which will store the type of association used between the variables. Dimension will be number of variables * number of variables.

Details

This function calls cor function to calculate the correlation values. The difference is that this doesn't take method as parameter, instead it decides the methods itself using normality tests. If the variables satisfy the assumption of Pearson correlation, then pearson correlation is calculated. Otherwise Spearman is calculated. To learn more, check the cor

Value

a list of two tables with number of rows and column equal to number of columns in numtb:

r

Table containing correlation values

r_pvalue

Table containing p-value for the correlation test

See Also

association for association between any type of variables, QQassociation for Association between Categorical variables, CQassociation for Association between Continuous-Categorical variables


[Package analyzer version 1.0.1 Index]