The chi-square test of association is used to determine if there is an association between two categorical variables.

In statistics, we call "dependent variable" a variable that is supposed to depend on the values of other variables, which are called "independent variables".

In regression, it is really clear which variable is dependent (the y that we are trying to predict) and which ones are independent (the xs predictors)

However it is not at all clear to me what are the "independent" and "dependent" variables in a chi-square test of association between variable A and B.

The options I see are:

  1. Both A and B are dependent variable; there is no independent variable
  2. Either A is dependent and B is independent, or A is independent and B is dependent. The variable that is hypothesized to cause the other is the independent variable, and the other is the dependent variable. If we don't know which one causes which, we pick randomly.
  3. Both A and B are independent variables; the dependent variable is actually the frequency (count) of each combination of A & B.
  4. The independent / dependent variable framework is inappropriate for chi-square tests of association

I read some support for all of these positions, so I'm confused as to which interpretation is preferable.

  • 3
    $\begingroup$ Re "in statistics, we call "dependent variable" a variable that is supposed to depend on the values of other variables, which are called "independent variables". That isn't correct: the terminology is specific to regression where "depend on" has a definite mathematical meaning. In other statistical settings the concepts of "dependent" and "independent" variables are often irrelevant or nonsensical. A chi-squared test of independence in a contingency table is one such setting. $\endgroup$
    – whuber
    Commented Nov 16, 2021 at 0:04
  • $\begingroup$ It depends on your circumstances; either one or the other or both may be considered the response. As long as the expected values are not small, the chi squared test should work for any of those cases. $\endgroup$
    – Glen_b
    Commented Nov 16, 2021 at 0:14

2 Answers 2


For the Chi-Square test you assume (the Null Hypothesis) the two variables are independent. If you reject the Null then you conclude the two variables are dependent on each other.

  • 1
    $\begingroup$ Correct, but that doesn't answer my original question. I'm asking if a given variable should be classified as an "independent" or "dependent" variable, not whether two variables are stochastically (in)dependent. $\endgroup$ Commented Nov 16, 2021 at 6:57
  • 1
    $\begingroup$ Such a classification (one categorical variable as dependent and the other as independent) doesn't make sense here and, as far as I'm aware, isn't used in the context of the chi-squared test of independence. $\endgroup$
    – num_39
    Commented Mar 9, 2022 at 15:10

It is always difficult to deal with the issues of statistical dependence and causality.

In a regression (or other data analysis models) one (or more) variable "depends" on others. With regression models, we are looking for statistical dependence (and maybe causality).

The chi-squared test is an association test between two categorical variables.

Let's take a couple of examples:

  1. the presence of cinema and McDonald's on the same street. Surely you will find an association between the two variables but with the chi-square test, you cannot establish which is the independent.

  2. If, on the other hand, you study the association between gender and the propensity to use medicines, the association is less obvious (to be tested with the chi-square test) but certainly, gender is to be considered independent as it is a temporal antecedent.

However, the chi-square test puts the two variables (gender and propensity) on the same level, without defining a priori the independent and the dependent one.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.