[R] Comparing two groups of proportions

Greg Snow Greg.Snow at imail.org
Tue Jun 10 04:57:54 CEST 2008

here is one approach:

res <- cbind( c(10, 5, 1, 12, 3,  8, 7, 2, 10, 1),
 c(90,15,79,38,7,92,13,78,40,9) )

line <- gl(5,1,length=10, labels=LETTERS[1:5])

qa <- gl(2,5)

fit <- glm( res ~ line*qa, family=binomial )


anova(fit, test='Chisq')

The interaction terms measure the difference between the different combinations of QA method and production line, if they are all 0, then that means the effect of QA is the same accross production lines and the qa main effect measures the difference between the 2 methods (allowing for differences in the prodoction lines), testing if that equals 0 should answer your question.

Hope this helps,

From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Ivan Adzhubey [iadzhubey at rics.bwh.harvard.edu]
Sent: Monday, June 09, 2008 4:28 PM
To: r-help at r-project.org
Subject: [R] Comparing two groups of proportions


I have a seemingly common problem but I can't find a proper way to approach
it. Let's say we have 5 samples (different size) of IC circuits coming from 5
production lines (A, B, C, D, E). We apply two different non-destructive QA
procedures to each sample, producing to sets of binary outcomes (passed:
no/yes). So, we have two groups of proportions:

        QA1             QA2
        no/yes  no/yes
A       10/90   8/92
B       5/15            7/13
C       1/79            2/78
D       12/38   10/40
E       3/7             1/9

How would I test if the two QA procedures in question give significantly
different results, at the same time controlling for the possible production
line contribution? It looks like there are many variants of multiple
proportions tests available in R and various extra packages but none seems to
exactly fit this very simple problem. I would appreciate any advice.


The information transmitted in this electronic communica...{{dropped:10}}

R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list