association {greybox}R Documentation

Measures of association

Description

Function returns the matrix of measures of association for different types of variables.

Usage

association(x, y = NULL, use = c("na.or.complete", "complete.obs",
  "everything", "all.obs"), method = c("auto", "pearson", "spearman",
  "kendall", "cramer"))

assoc(x, y = NULL, use = c("na.or.complete", "complete.obs", "everything",
  "all.obs"), method = c("auto", "pearson", "spearman", "kendall", "cramer"))

Arguments

x

Either data.frame or a matrix

y

The numerical variable.

use

What observations to use. See cor function for details. The only option that is not available here is "pairwise.complete.obs".

method

Which method to use for the calculation of measures of association. By default this is "auto", which means that the function will use: cor, mcor or cramer - depending on the scales of variables. The other options force the function to use one and the same method for all the variables:

  • "pearson" - Pearson's correlation coefficient using cor;

  • "spearman" - Spearman's correlation coefficient based on cor;

  • "kendall" - Kendall's correlation coefficient via cor;

  • "cramer" - Cramer's V using cramer;

Be aware that the wrong usage of measures of association might give misleading results.

Details

The function looks at the types of the variables and calculates different measures depending on the result:

After that the measures are wrapped up in a matrix.

Function also calculates the p-values associated with the respective measures (see the return).

See details in the vignette "Marketing analytics with greybox": vignette("maUsingGreybox","greybox")

assoc() is just a short name for the association{}.

Value

The following list of values is returned:

Author(s)

Ivan Svetunkov, ivan@svetunkov.ru

See Also

table, tableplot, spread, cramer, mcor

Examples


association(mtcars)


[Package greybox version 2.0.1 Index]