Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: How to compare two contingency tables?

0 views
Skip to first unread message

RichUlrich

unread,
Oct 4, 2008, 5:21:09 PM10/4/08
to
[cross-posted, sci.stat.math and sci.stat.consult]

On Wed, 1 Oct 2008 18:29:04 -0700 (PDT), Ray Koopman <koo...@sfu.ca>
wrote:

>On Oct 1, 3:53 pm, Wei <weif...@gmail.com> wrote:
>> Hi,
>>
>> If I have two 2x2 contingency tables, how do I perform a chi-square
>> test to compare them to see if they are sampled from the same
>> underlying distribution? Thanks!
>>
>> Wei
>
>If the row totals and the column totals were unconstrained in
>each 2 x 2 table then do a Pearson chi-square on the 2 x 4 table
>in which each row is one of the 2 x 2 tables written as a vector.

I had to remind myself that there could be "constrained"
sampling, and how that would differ.

Comparing the 4 cells to 4 cells gives a 3 d.f. test, which
covers, potentially, three hypotheses. If one (or two)
of the sets of marginals are constrained to be equal, then
the 4x2 table could be compared to a two (or one) d.f.
chisquared table, instead of 3 d.f.


But with constraints,, it would be better to employ the logistic-
regression solution that was described by Bruce Weaver
in the other group where the question was posted -- predict
the Sample by using the two Variables as predictors, and also,
their interaction. That accounts for all three d.f.

An explicit example: Take the initial 2x2 tables as Sex by B(0,1),
with Species(0,1) defining the two samples.

If one intentionally sampled equal numbers of the two
sexes for each species, then there would be "zero" for the
Species-by-Sex association. And the only possible "differences
in distribution" would exist in the other two d.f., the association
of Species with B, and Species with the Sex-by-B interaction.
That last term is one that says, essentially, that the Odds
Ratios for Sex-by-B are different for the two species.

If Sex *and* B were both constrained, the only testable
difference would be the 1 d.f. for the Odds Ratios.

--
Rich Ulrich

0 new messages