3
$\begingroup$

I am doing my undergraduate project and have tested a drug on cells for a responce. The data I have collected shows that the cells either produced a responce, or they did not. Binomial data?

Control 0ug/mL      22  3053
Control2 (DMSO)     15  2807
5ug/mL rapamycin    12  3070
10ug/mL rapamycin   7   2806

The first number is the number of cells that produced the responce, and the second number is the total number of cells tested.

I'm trying to work out the test I can use to see if the results between the groups are significant. I was think a Fisher's exact test, but I wasn't sure if that was just for 2x2 tables. Would a chi sq test be sufficient?

$\endgroup$

3 Answers 3

6
$\begingroup$

In R, you can use

prop.test(x=c(22, 15, 12, 7), n=c(3053, 2807, 3070, 2806))

to compare the four proportions. Or as you noted, a $\chi^2$-Test can also be used:

m <- matrix(c(22, 15, 12, 7, 3053-22, 2807-15, 3070-12, 2806-7), 2, 4, byrow=T)
chisq.test(m)

The results are exactly the same.

$\endgroup$
5
$\begingroup$

You can use a logistic regression.

dat.text <- "Treatment x n
Control1      22  3053
Control2     15  2807
5ug    12  3070
10ug   7   2806"

dat <- read.table(text=dat.text,header=TRUE)

fit <- glm(cbind(x,n-x)~0+Treatment, data=dat, family="binomial")
summary(fit)

Then use the multcomp package to get confidence intervals and multiple comparisons:

library(multcomp)
plot(confint(glht(fit)))  # confidence intervals of logit(p)

The lsmeans package is useful too. It has a convenient syntax for multiple comparisons:

library(lsmeans)
lsmeans(fit, pairwise~Treatment)

Actually it is interesting to jointly use multcompand lsmeans. For instance the following code provides the same results as the previous one:

M <- lsmeans(fit, pairwise~Treatment, lf=TRUE)[[2]] # extract the matrix of pairwise comparisons
summary(glht(fit, linfct=M))
$\endgroup$
2
  • 1
    $\begingroup$ I think you want fit <- glm(cbind(x,n-x)~0+Treatment, data=dat, family="binomial") instead. Note ?glm requires as an argument a two-column matrix with the columns giving the numbers of successes and failures, not successes and trials. $\endgroup$
    – C8H10N4O2
    Oct 2, 2015 at 18:03
  • $\begingroup$ You're welcome. By the way I posted a question today about group differences that has very low views -- I would much appreciate if you could take a look! Cheers $\endgroup$
    – C8H10N4O2
    Oct 2, 2015 at 19:05
2
$\begingroup$

You just have a binomial experiment, so your confidence interval is given by Binomial proportion confidence interval. After you calculate them you can figure out if the intervals overlap or not.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.