Learn R Programming

GDAtools (version 1.7)

assoc.catcont: 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=rep(1,length(x)),
              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

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

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 :

eta.squared

eta-squared between the two variables

permutation.pvalue

p-value from a permutation (so 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

References

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

See Also

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

Examples

Run this code
# NOT RUN {
## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
## Page 9: Plant Weight Data.
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
assoc.catcont(group,weight,nperm=100)
# }

Run the code above in your browser using DataLab