Dormitory residency is sometimes advertised as being
beneficial to students because it helps foster
a connectedness to the university and
maybe help the students develop an academic lifestyle.
In one study involving 408 entering students in 1995,
students were classified according to (i) whether they
lived in a campus dormitory during their first year,
and (ii) whether they had graduated within 6 years of
entering college.
The data is presented in a
cross-classification table below.

Table 9.2:
Dorm Residency versus Graduation Rate

Dorm

Not Dorm

Grad
6 Yrs.

204

20

Grad > 6 Yrs.

160

24

We are interested in comparing 6-year graduation rate of
dormitory residents versus non-dormitory residents.
In terms of population parameters, we write the null and
alternative hypotheses as

where p1 and p2 are the population graduation rates for dorm
and non-dorm residents, respectively.

Note that IF we treat dorm residency as a variable,
then a test for independence between graduation rate and residency also
compares graduation rate between dorm and non-dorm students.
Therefore, we may use the chi-square test of independence to
test for equality of proportions between populations.
In this case, it is called a test for equality of proportions
rather than a test for independence. The null and alternative
hypotheses are written differently, but the rest of the test procedure
remains the same.

If the row variable has only two categories (Success-Failure), and the
columns are population labels rather than levels of a second variable,
the chi-square test of independence is called a test for equality of
proportions.

First compute the graduation rate marginal distribution:

Dorm

Not Dorm

Total

Grad
6 Yrs.

224 (This is 54.9% of 408)

Grad > 6 Yrs.

184 (This is 45.1% of 408)

Total

364

44

408

Extrapolating the marginal distribution to each individual column, we
get the following expected frequencies:

(.549)(364)=199.84

(.549)(44)=24.16

(.451)(364)=164.16

(.451)(44)=19.84

The chi-square test compares these expected frequencies to the observed frequencies.
The null hypothesis is rejected if observed and expected frequencies are too far apart.

Here is the way a statistical report would formally present the test, in numbered stages.