Possible alternatives if your data violate contingency table analysis assumptions

Home | StatGuide | Glossary


If the data to be analyzed by a contingency table analysis come from population(s) whose distribution violates the assumption of independence of the sample values or if interactions are present, then the contingency table analysis may provide misleading results.

If one or both of the cross-classification variables is ordered or continuous instead of nominal, then a more powerful test may be available.

In such cases an alternative test may provide a better analysis.

Alternative tests:


  • Tests when the samples are not independent:
  • If the assumption of independence of the sampled values is violated, then neither the chi-square test nor Fisher's exact test is appropriate. If the same same subject (or related subjects) produces more than one observation in the contingency table, then this assumption will be violated. For example, consider an experiment recording the severity of a medical condition (severe or not) before and after a treatment for that condition. Each subject in the experiment would lead to two observations, one before and one after treatment. For such data, Cochran's Q test or McNemar's Q test) would be appropriate.
  • Tests when there are interactions:
  • If the results of the chi-square analysis indicates that there may be interactions between row and column effects, then a more general logit or loglinear model will allow for the inclusion of interaction effects in the model. Agresti and Bishop et al. discuss logit and loglinear models. If you are not familiar with logit and loglinear models, you should consult with a statistician before proceeding.
  • Tests when there are structural zeroes:
  • The chi-square test and Fisher's exact test are not designed for contingency tables with structural zeroes. A more general logit or loglinear model will allow for the modeling of data that include structural zeroes. Agresti and Bishop et al. discuss logit models. If you are not familiar with logit/loglinear models, you should consult with a statistician before proceeding.
  • Tests when a cross-classification variable is not nominal:
  • The chi-square test ignores any possible ordering of either the row or column variables. If either or both of the row or column variables is ordinal (having a natural order) or continuous, then an alternative test to the chi-square or Fisher's exact test may be more powerful, especially if one of the variables is an outcome variable (Y) and the other an explanatory variable (X).

The list below gives some possible alternative tests for the cases when X and Y are not both nominal. This is not meant to be an exhaustive list, and you should consult a statistician if you are interested in applying a test with which you are not familiar. Most of these tests are usually calculated on data in the form of individual observations instead of in the frequency counts of a contingency table.

X variable is nominal:

Y is nominal:

Y is ordinal:

  • Kruskal-Wallis test with scores assigned to Y values to preserve the ordering
  • logit row-effects models (discussed in Agresti)

Y is continuous:

X variable is ordinal:

Y is nominal:

  • logit column-effects models (discussed in Agresti)
  • logistic regression (discussed in Agresti) with scores assigned to X values to preserve the ordering

Y is ordinal:

  • Jonckheere-Terpstra test (discussed in Lehmann) with scores assigned to X values to preserve the ordering
  • linear-by-linear logit models (discussed in Agresti)

Y is continuous:

  • Jonckheere-Terpstra test (discussed in Lehmann)

X variable is continuous:

Y is nominal:

  • logistic regression (discussed in Agresti)

Y is ordinal:

  • logit models for ordered response variable Y (discussed in Agresti), such as cumulative logits models

Y is continuous:


Glossary | StatGuide Home | Home