Re: [R] How to test a difference in ratios of count data in R

2016-09-30 Thread David Winsemius
> On Sep 30, 2016, at 9:40 AM, Shuhua Zhan wrote: > > > Thank you, David and Greg for your help! > I drew conclusion that the treatment B significantly increases the ratio of x > group (X/n) from based on p values from the treatmentB line of the outputs > at logistic reg.

Re: [R] How to test a difference in ratios of count data in R

2016-09-30 Thread Shuhua Zhan
Thank you, David and Greg for your help! I drew conclusion that the treatment B significantly increases the ratio of x group (X/n) from based on p values from the treatmentB line of the outputs at logistic reg. and Poisson reg.(p=6.11e-07, Logistic; p=0.000152, Poisson). I'm wondering

Re: [R] How to test a difference in ratios of count data in R

2016-09-29 Thread Greg Snow
It is usually best to keep these discussions on the list. Someone else may have a better answer than mine, or be able to respond quicker, and if I answer on R-help then it is community service/involvement. If I respond directly then it is consulting and then we need a contract and I have to

Re: [R] How to test a difference in ratios of count data in R

2016-09-28 Thread David Winsemius
> On Sep 28, 2016, at 9:49 AM, Greg Snow <538...@gmail.com> wrote: > > There are multiple ways of doing this, but here are a couple. > > To just test the fixed effect of treatment you can use the glm function: > > test <- read.table(text=" > replicate treatment n X > 1 A 32 4 > 1 B 33 18 > 2 A

Re: [R] How to test a difference in ratios of count data in R

2016-09-28 Thread Greg Snow
There are multiple ways of doing this, but here are a couple. To just test the fixed effect of treatment you can use the glm function: test <- read.table(text=" replicate treatment n X 1 A 32 4 1 B 33 18 2 A 20 6 2 B 21 18 3 A 7 0 3 B 8 4 ", header=TRUE) fit1 <- glm( cbind(X,n-X) ~ treatment,

[R] How to test a difference in ratios of count data in R

2016-09-27 Thread Shuhua Zhan
Hello R-experts, I am interested to determine if the ratio of counts from two groups differ across two distinct treatments. For example, we have three replicates of treatment A, and three replicates of treatment B. For each treatment, we have counts X from one group and counts Y from another