pronounced “kigh square”

Used when measuring a nominal variable. We deal with the frequency of individuals in a caregory (like “republicans” or “answered yes”). It allows us to answer questions like “40% of people said yes.. but does this reflect what we’d expect from the underlying population?”

There is no limit on the number of categories we can test. When we have one variable, we use the one-way chi square procedure and two variables means two-way.

When reported in a paper, it looks like which says “df=1, N=50 we found it significant with a of 18.00.

Definitions

observed frequency : . The frequency that participants fall into a given category

expected frequency : . Frequency we expected in a category if the sample data perfectly represented the distribution of the population described by (no difference) aka .

one-way chi square procedure

There are 5 assumptions of this test.

  1. Participants are categorized along one variable having 2+ categories and we can count the frequency in those categories.
  2. Each participant can only be in one category.
  3. Category membership is indepenent (the fact that someone is in one category does not influence the probability that another participant will be in any category)
  4. We include the responses of all participants in the study
  5. The “expected frequencies” must be at least 5 per category.

There’s no standard way to state the null hypothesis, so we say:

and

Formulas:

Unlike ANOVA, there is no post-hoc testing nor effect size to calculate. Merely documentation of what the observed frequency is.

example

We’re testing whether geniuses are more often left-handed than the population.

In the population, we know that left-handedness happens 10% of the time.

Looking at geniuses, we see a 20% rate.

left handedright handed
f_o = 10f_o = 40
f_e = 5f_e = 45

Because and , so this is a significant difference.

two-way chi square procedure

Tests whether or not a variable is independent of (e.g. unrelated to) another category. This is like interaction testing in two-way ANOVA.

Used when there are two variables like this. Note that it doesn’t have to be a 2x2 design, but could be 4x7. As long as there are only two factors.

type A personalitytype B
heart attack
no heart attack

A dataset of complete independence would be:

type A personalitytype B
heart attack2020
no heart attack2020

Total dependence would be:

type A personalitytype B
heart attack400
no heart attack040

: Category membership is indepentend of category membership in the other. : The category membership is dependent.

In this setup, we can find the expected frequency via:

example

type A personalitytype B
heart attack2510
no heart attack540
  1. Calculate for each cell:
type A personalitytype B
heart attack(30*35)/80 = 13.125(50*35)/80 = 21.875
no heart attack(45*30)/80 = 16.875(50*45)/80 = 28.125
  1. Calculate .

so this result is significant and we can reject

Post-hoc testing

We can post-hoc test two-way chi square.

phi coefficient

. A post-hoc test for 2x2 chi-square to deteremine how independent it is. 0 is complete independence. 1 is total dependence. Real research tends to be in the .2 - .5 range.

Given the example above, , so this is a pretty strong effect.

Squaring a correlation coefficient gives us the “proporiton of variance accounted for” (a la Effect size), so says 38% of the differences is associated with their personality type.

contingency coefficeint

. This is like the phi-coefficient for things that aren’t 2x2 (e.g. 2x3 or 3x3 etc).