assoc.catcont {descriptio}R Documentation

Measures the association between a categorical variable and a continuous variable

Description

Measures the association between a categorical variable and a continuous variable

Usage

assoc.catcont(x, y, weights = NULL,
              na.rm.cat = FALSE, na.value.cat = "NA", na.rm.cont = FALSE,
              nperm = NULL, distrib = "asympt", digits = 3)

Arguments

x

the categorical variable (must be a factor)

y

the continuous variable (must be a numeric vector)

weights

numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used.

na.rm.cat

logical, indicating whether NA values in the categorical variable (i.e. x) should be silently removed before the computation proceeds. If FALSE (default), an additional level is added to the categorical variable (see na.value.cat argument).

na.value.cat

character. Name of the level for NA category. Default is "NA". Only used if na.rm.cat = FALSE.

na.rm.cont

logical, indicating whether NA values in the continuous variable (i.e. y) should be silently removed before the computation proceeds. Default is FALSE.

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

digits

integer. The number of digits (default is 3).

Value

A list with the following elements :

summary

summary statistics (mean, median, etc.) of the continuous variable for each level of the categorical variable

eta.squared

eta-squared between the two variables

permutation.pvalue

p-value from a permutation (i.e. non-parametric) test of independence

cor

point biserial correlation between the two variables, for each level of the categorical variable

cor.perm.pval

permutation p-value of the correlation between the two variables, for each level of the categorical variable

test.values

test-values as proposed by Lebart et al (1984)

test.values.pval

p-values corresponding to the test-values

Author(s)

Nicolas Robette

References

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

Lebart L., Morineau A. and Warwick K., 1984, *Multivariate Descriptive Statistical Analysis*, John Wiley and sons, New-York.

See Also

assoc.twocat, assoc.twocont, assoc.yx, condesc, catdesc, darma

Examples

data(Movies)
with(Movies, assoc.catcont(Country, Budget, nperm = 10))

[Package descriptio version 1.3 Index]