Skip to content
Statistics

Is it possible to capture the correlation between a continuous and a categorical variable?

Yes. Use the point-biserial correlation when the category has two levels, or one-way ANOVA with eta squared (the correlation ratio) for more levels; Kruskal-Wallis if the data are skewed. ANCOVA answers a different question: it compares group means while adjusting for a continuous covariate.

datasciencetrivia.com

Card 1 of 276. Answer: Yes. Use the point-biserial correlation when the category has two levels, or one-way ANOVA with eta squared (the correlation ratio) for more levels; Kruskal-Wallis if the data are skewed. ANCOVA answers a different question: it compares group means while adjusting for a continuous covariate.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.

The longer answer

Yes, but ANCOVA is not the usual tool. Use the point-biserial correlation when the categorical variable has two levels, and one-way ANOVA with eta squared (η²) when it has more. ANCOVA compares group means of an outcome while adjusting for a continuous covariate, which is a different question.

The point-biserial correlation is Pearson's r with the groups coded 0 and 1; its significance test is equivalent to Student's two-sample t-test. For several groups, η² = SS_between / SS_total, the share of the continuous variable's variance explained by group; its square root η is the correlation ratio. Example: exam scores with SS_total = 1200 and SS_between = 300 across three teaching methods give η² = 0.25.

Do not feed arbitrary codes like 1, 2, 3 into Pearson's r: the result changes with the coding. For skewed groups, use Kruskal-Wallis. Interviewers often ask about other pairings: Pearson or Spearman for two continuous variables, Cramér's V for two categorical ones, and mutual information for any mix.

All questions