Log-Linear Analysis for a 2x2x2 Table of Cross-Categorized Frequency Data

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.

This page will calculate the values of G2 for first- and second-order interaction effects for a table of observed frequency data cross-classified according to three categorical variables, A, B, and C, each of which has two levels or subcategories (A1, A2; B1, B2; C1, C2). The values of A1B1C1, A1B1C2, etc., may be entered directly into the designated cells. When all cell values have been entered, click the "Calculate" button, then scroll down the page to view the results of the calculation. To perform a new analysis with a new set of data, click the "Reset" button.
Log-linear analysis, which is essentially a variation on the logic and procedures of chi-square, assumes that all entered values are positive integers representing observed frequencies.
Data Entry
 A1 A2 C1 C2 C1 C2 B1 B1 B2 B2
 df [ABC] = 4G2 [ABC] = p = Note that G2 is distributed approximately as chi-square. p values are derived by referring calculated values of G2 to the appropriate sampling distributions of chi-square.

 AB Table AC Table BC Table B1 B2 C1 C2 C1 C2 A1 A1 B1 A2 A2 B2 df [AB] = 1G2 [AB] = p = df [AC] = 1G2 [AC] = p = df [BC] = 1G2 [BC] = p = df [ABC-AB] = 3G2 [ABC-AB] = p = df [ABC-AC] = 3G2 [ABC-AC] = p = df [ABC-BC] = 3G2 [ABC-BC] = p = df [ABC-AC-BC] = 2G2 [ABC-AC-BC] = p = df [ABC-AB-BC] = 2G2 [ABC-AB-BC] = p = df [ABC-AB-AC] = 2G2 [ABC-AB-AC] = p = AB(C) Tables AC(B) Tables BC(A) Tables AB(C1) AC(B1) BC(A1) B1 B2 C1 C2 C1 C2 A1 A1 B1 A2 A2 B2 df [AB(C1)] = 1G2 [AB(C1)] = p = df [AC(B1)] = 1G2 [AC(B1)] = p = df [BC(A1)] = 1G2 [BC(A1)] = p = AB(C2) AC(B2) BC(A2) B1 B2 C1 C2 C1 C2 A1 A1 B1 A2 A2 B2 df [AB(C2)] = 1G2 [AB(C2)] = p = df [AC(B2)] = 1G2 [AC(B2)] = p = df [BC(A2)] = 1G2 [BC(A2)] = p =

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