Log-Linear Analysis for an AxBxC Contingency Table
Log-linear analysis is a version of chi-square analysis in which the relevant values are calculated by way of weighted natural logarithms. The first advantage of this procedure is that it is easier to program in the case of a complex 3-way contingency table, since it allows all chi-square values to be derived through simple addition and subtraction of various combinations of the weighted logarithms. The second advantage is that the chi-square values thus derived are linear, which allows for more complex analyses not readily available through the conventional chi-square computational procedure.

When a chi-square value is calculated by the log-linear method, it is typically designated as G2 as an indication of its computational origin. Since G2 is distributed approximately as chi-square, its associated probability under the null hypothesis can be estimated through reference to the appropriate sampling distribution of chi-square, as defined by its degrees of freedom. Values of G2 will usually be quite close to the corresponding values of chi-square that would be calculated using the conventional procedure.

For a 3-way contingency table containing up to 5 rows (A), 5 columns (B), and 5 layers (C), the present page will calculate the following seven values of G2:Q
 ABC Representing the 3-way interaction between A, B, and C. AB Representing the 2-way interactions for AB, AC, and BC, respectively. These are the same measures that would be obtained from an AB table collapsed across the levels of C, an AC table collapsed across the levels of B, and a BC table collapsed across the levels of A. AC BC AB(C) Representing the 2-way interactions for each pair of variables, AB, AC,and BC, when the effects of the third variable are removed from the picture. Thus, AB(C) represents the AB interaction when the AC and BC interactions are removed. It is the same measure that would be obtained by constructing a separate AB table for each level of C, calculating a separate G2 measure for each, and then summing the results. AC(B) BC(A)

To begin, enter the numbers of rows, columns, and layers in the designated places, then click the «Setup» button and enter your data into the appropriate cells of the data-entry matrices. After all data have been entered, click one of the «Calculate» buttons.
 rows (A)     columns (B)   layers (C)

Data Entry
 C1 B1 B2 B3 B4 B5 A1 A2 A3 A4 A5
 C2 B1 B2 B3 B4 B5 A1 A2 A3 A4 A5

 C3 B1 B2 B3 B4 B5 A1 A2 A3 A4 A5
 C4 B1 B2 B3 B4 B5 A1 A2 A3 A4 A5

 C5 B1 B2 B3 B4 B5 A1 A2 A3 A4 A5

Results:
 Source G2 df P ABC AB AC BC AB(C) AC(B) BC(A)

 Home Click this link only if you did not arrive here via the VassarStats main page.