The G-test is a measure of statistical significance for proportions, similar to the Chi-square test, which measures the degree to which a particular triple (w, r, w ) was found to occur more frequently than expected given all relations (w , r, w ).
if w occurs far more often with w than it does with other words, then it will receive a high G-test score for w. the G-test score is computed according to the following equation: where the index i ranges over the four cells of a 2x2 contingency table, O i is the observed count in cell i, and E i is the expected count in the same cell.