apologies if this is a trivial question. I'm trying to determine
whether differences between proportions in two independent groups are
significant. To give a fictional non-linguistic example:
Are differences between male and female voters greater in urban
environments than in rural environments? Suppose we sample one entire
city and one entire rural area and check how many people opted to be
represented by the 'clown party', as opposed to some other party. We
end up with two 2x2 contingency tables:
City:
M F
clown party 1108 292
other 1940 6487
totals 3048 6779
Country:
M F
clown party 329 40
other 1501 949
totals 1830 989
In both environments, males are significantly more likely to vote for
said party. This tendency is more pronounced in the city - but how do
I show that it is significant? I guess I could run a logistic
regression to show that both gender and environment are significant
predictors of party affiliation, but that seems a lot of machinery for
a simple question.
Many thanks, --M
------------------------------------------
Martin Hilpert
International Computer Science Institute
1947 Center Street
Berkeley, CA 94704
Work: (510) 666 2937
Home: (510) 528 4103
Cell: (510) 734 0106
http://www.icsi.berkeley.edu/~hilpert
(i) You could do the logistic regression you mention and see whether
the variable ENVIRONMENT: city vs. country modifies the interaction
between SEX: male vs. female and PARTY: clowns vs. others. I don't
think that's too much of an overkill.
(ii) You could check whether the confidence intervals of the odds
ratios of both tables overlap, which they don't so there's a sign.
difference
# set up data for ENVIRONMENT: city
tab1<-matrix(c(1108,292,1940,6487), byrow=T, ncol=2)
rownames(tab1)<-c("clowns", "others"); colnames(tab1)<-c("male", "female")
# set up data for ENVIRONMENT: country
tab2<-matrix(c(329,40,1501,949), byrow=T, ncol=2)
rownames(tab2)<-c("clowns", "others"); colnames(tab2)<-c("male", "female")
fisher.test(tab1)
fisher.test(tab2)
(iii) You could do the Mantel-Haenszel test, which also shows a sign.
difference:
array.1and2<-array(c(1108,292,1940,6487,329,40,1501,949),
dim=c(2,2,2), dimnames=list(PARTY=c("clowns","others"),SEX=c("male","female"),ENVIRONMENT=c("city","country")))
mantelhaen.test(array.1and2)
?mantelhaen.test
HTH,
STG
--
Stefan Th. Gries
-----------------------------------------------
University of California, Santa Barbara
http://www.linguistics.ucsb.edu/faculty/stgries
-----------------------------------------------