Learn R Programming

greybox (version 0.5.3)

association: 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"))

assoc(x, y = NULL, use = c("na.or.complete", "complete.obs", "everything", "all.obs"))

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".

Value

The following list of values is returned:

  • value - Matrix of the coefficients of association;

  • p.value - The p-values for the parameters;

  • type - The matrix of the types of measures of association.

Details

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

  • If both variables are numeric, then Pearson's correlation is calculated;

  • If both variables are categorical, then Cramer's V is calculated;

  • Finally, if one of the variables is categorical, and the other is numeric, then multiple correlation is returned.

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{}.

See Also

table, tableplot, spread, cramer, mcor

Examples

Run this code
# NOT RUN {
association(mtcars)

# }

Run the code above in your browser using DataLab