Using Chi Square Test when more than two Rows are Present
To understand this, let us consider the contingency table shown below. It gives us the information about the stage of the economy and the number of PCs sold on a weekly basis.

Weekly sale of PCs

Total

High

Medium

Low

Economy at Peak
Economy at Trough
Economy Rising
Economy Falling

20
13
18
14

14
12
9

10
5
9
8

44
26
39
31

Total

65

43

32

140

For calculating the proportion of sales during a weekly high, when the economy was rising we employ the formula of joint probability for two independent events A and B. The event A stands for proportion of sales durings a high irrespective of the stage of the economy and is given by (65/140), whereas the proportion of sales when the economy was rising irrespective of the weekly sales is (39/140). Since these two events happen to be independent events, the joint probability that they will occur simultaneously is
= (65/140)(39/140)
= 2535/19600
Similarly the proportion of sales, when the weekly sales are low and the economy at its peak is given by the product of
= (32/140)(44/140)
= 1408/19600
Since these figures give us the expected proportions to calculate the theoretical proportions, we multiply the above values with the total number of observations. Therefore, the theoretical proportion for the cell (economy rising, high) is given by
(2535/19600) x 140 = 18.107
and for the cell (economy at peak, low) the theoretical proportion is
(1408/19600) x 140 = 10.06
Generalizing this, the expected frequency for any cell (intersection point of the concerned row and the column) is given by the product of the sum of the elements in that row (usually denoted by TR_{i}, i = 1, 2) and the sum of the elements in that column (denoted by CRj, j = 1, 2, 3) divided by the total number of observations. Mathematically it is expressed as
After this step, we proceed in the same manner as we do in case of contingency table having two rows and a given number of columns.