Function returns the matrix of measures of association for different types of variables.
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"))
Either data.frame or a matrix
The numerical variable.
What observations to use. See cor function for details.
The only option that is not available here is "pairwise.complete.obs"
.
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.
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{}
.
# NOT RUN {
association(mtcars)
# }
Run the code above in your browser using DataLab