text stringlengths 0 6.73k |
|---|
data was displayed in a rectangular table of cells. Each table consisted of one row |
and a specified number of columns, where the columns corresponded to categories |
into which the population had been divided. We now study problems in which the |
data also consists of counts or frequencies, but the data table will now have / rows |
(I > 2) and J columns, so /J cells. There are two commonly encountered situations |
in which such data arises: |
1. There are / populations of interest, each corresponding to a different row of the |
table, and each population is divided into the same J categories. A sample is |
taken from the ith population (i = 1, ..., J), and the counts are entered in the |
cells in the ith row of the table. For example, customers of each of J = 3 |
department store chains might have available the same J =5 payment |
categories: cash, check, store credit card, Visa, and MasterCard. |
2. There is a single population of interest, with each individual in the population cate- |
gorized with respect to two different factors. There are / categories associated |
with the first factor, and J categories associated with the second factor. A single |
sample is taken, and the number of individuals belonging in both category 7 of factor |
1 and category j of factor 2 is entered in the cell in row i, column j (i = 1, ..., J; |
j= 1,...,J). As an example, customers making a purchase might be classified |
according to both department in which the purchase was made, with / = 6 |
departments, and according to method of payment, with J = 5 as in (1) above. |
Let nj; denote the number of individuals in the sample(s) falling in the (i, j )th cell |
(row i, column j) of the table—that is, the (i, )th cell count. The table displaying |
the n,; s is called a two-way contingency table; a prototype is shown in Table 13.9. |
Table 13.9 A two-way contingency table |
5 ee ce | |
[im [mw [= [ow [= [om | |
atut [ot ft fi: | |
ge ee |
tft] [TT [=] |
--- Trang 758 --- |
13.3 Two-Way Contingency Tables 745 |
In situations of type 1, we want to investigate whether the proportions in the |
different categories are the same for all populations. The null hypothesis states that |
the populations are homogeneous with respect to these categories. In type 2 situa- |
tions, we investigate whether the categories of the two factors occur independently |
of each other in the population. |
Testing for Homogeneity |
We assume that each individual in every one of the / populations belongs in exactly |
one of J categories. A sample of n; individuals is taken from the ith population; let |
n= Zn,and |
nj = the number of individuals in the ith sample who fall into category j |
y the total number of individuals among |
n= ny = A A |
4 fal 1 the n sampled who fall into category j |
The nj’s are recorded in a two-way contingency table with J rows and J columns. |
The sum of the nj;’s in the ith row is n;, whereas the sum of entries in the jth column |
is nj. |
Let |
__ the proportion of the individuals in |
Py = population 7 who fall into category j |
Thus, for population 1, the J proportions are pj, P12, ..., Piz (Which sum to 1) and |
similarly for the other populations. The null hypothesis of homogeneity states that |
the proportion of individuals in category j is the same for each population and |
that this is true for every category; that is, for every j, pyj = Px = °** = Pyj- |
When H) is true, we can use pj, >, ..., Py to denote the population propor- |
tions in the J different categories; these proportions are common to all / popula- |
tions. The expected number of individuals in the ith sample who fall in the jth |
category when Hp is true is then E(N;j) = n;- p;. To estimate E(Nj;), we must first |
estimate p;, the proportion in category j. Among the total sample of n individuals, |
N, fall into category j, so we use pj = N.j/n as the estimator (this can be shown to |
be the maximum likelihood estimator of p,). Substitution of the estimate p; for p; in |
nip; yields a simple formula for estimated expected counts under Ho: |
‘ ‘ Fi fn, |
é;; = estimated expected count in cell (i,j) = nj: |
n |
__ (ith row total)(jth column total) (13.10) |
7 n |
The test statistic also has the same form as in previous problem situations. The |
number of degrees of freedom comes from the general rule of thumb. In each row of |
Table 13.9 there are J — 1 freely determined cell counts (each sample size n; is |
fixed), so there are a total of /(J — 1) freely determined cells. Parameters p, .. ., py |
are estimated, but because Xp; = 1, only J — | of these are independent. Thus |
df = IJ -1)-V-1) = V-1)d-D. |
--- Trang 759 --- |
746 = carrer 13. Goodness-of-Fit Tests and Categorical Data Analysis |
Null hypothesis: Ho : pry = px =+:- = py f= 1,2,-...5 |
Alternative hypothesis: H, : Ho is not true |
Test statistic value: |
2 y (observed — estimated expected)? _ y y (ny ei) |
a ; estimated expected - ej |
all cells i=l j=l |
Rejection region: 77 > 73)1)—1 |
P-value information can be obtained as described in Section 13.1. The test |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.