Measures the association between a continuous variable and some continuous and/or categorical variables

condesc(y, x, weights=rep(1,length(y)), min.cor=NULL, 
robust=TRUE, nperm=NULL, distrib="asympt", dec=c(3,3,0,3))

Arguments

y

the continuous variable to describe

x

a data frame with continuous and/or categorical variables

weights

an optional numeric vector of weights (by default, a vector of 1 for uniform weights)

min.cor

for the relationship between y and a categorical variable, only associations higher or equal to min.cor will be displayed. If NULL (default), they are all displayed.

robust

logical. If FALSE, mean and standard deviation are used instead of median and mad. Default is TRUE.

nperm

numeric. Number of permutations for the permutation test of independence. If NULL (default), no permutation test is performed.

distrib

the null distribution of permutation test of independence can be approximated by its asymptotic distribution ("asympt", default) or via Monte Carlo resampling ("approx").

dec

vector of 4 integers for number of decimals. The first value if for association measures, the second for permutation p-values, the third for medians and mads, the fourth for point biserial correlations. Default is c(3,3,0,3).

Value

A list of the following items :

variables

associations between y and the variables in x

categories

a data frame with categorical variables from x and associations measured by point biserial correlation

References

Rakotomalala R., 'Comprendre la taille d'effet (effect size)', [http://eric.univ-lyon2.fr/~ricco/cours/slides/effect_size.pdf]

Author

Nicolas Robette

See also

Examples

data(Movies) condesc(Movies$BoxOffice, Movies[,c("Budget","Genre","Country")])
#> $variables #> variable measure association permutation.pvalue #> 1 Genre Eta2 0.173 NA #> 2 Country Eta2 0.048 NA #> 3 Budget Kendall's tau 0.518 NA #> #> $categories #> categories median.y.in.xcat median.y.global mad.y.in.xcat #> 9 Genre.SciFi 944784 138609 853626 #> 2 Genre.Animation 954956 138609 853018 #> 13 Country.USA 356692 138609 286508 #> 1 Genre.Action 291945 138609 247538 #> 10 Country.Europe 153755 138609 150015 #> 5 Genre.Comedy 230615 138609 210550 #> 3 Genre.Other 249037 138609 231954 #> 12 Country.Other 64893 138609 46042 #> 8 Genre.Horror 293118 138609 176131 #> 6 Genre.Documentary 13470 138609 12078 #> 4 Genre.ComDram 91380 138609 88602 #> 7 Genre.Drama 49219 138609 44946 #> 11 Country.France 77352 138609 78519 #> mad.y.global cor #> 9 137253 0.294 #> 2 137253 0.211 #> 13 137253 0.192 #> 1 137253 0.087 #> 10 137253 0.068 #> 5 137253 0.004 #> 3 137253 -0.005 #> 12 137253 -0.013 #> 8 137253 -0.015 #> 6 137253 -0.108 #> 4 137253 -0.114 #> 7 137253 -0.162 #> 11 137253 -0.211 #>