# Count explanatory variable, ratio dependent variable

I am having a little trouble coming up with a way of analyzing my data. If there is a short answer (i.e., "use logistic regression, dummy") you can just post that and I'll do some digging on my own - I just need to be pointed in the right direction...

My independent variable is a count and my dependent variable is a ratio. Here is the data:

success <- c(322,358,323,277)
total.trials <- c(540,533,507,540)
count = c(23,13,21,39)
ratio <- success/total.trials


IIRC, It's wrong to do a simple linear regression of ratio ~ count... so what method should I utilize here? Thanks for the help.

Okay, so here's some of the code I ran after following gung's advice of employing the use of the GEE:

subject <- c(1, 2, 3, 4)
success <- c(322, 358, 323, 277)
total <- c(540, 533, 507, 540)
count <- c(23, 13, 21, 39)
data <- cbind(success,total)

gee.model <- gee(data ~ count, id = subject, family = 'binomial')

summary(gee.model)

GEE:  GENERALIZED LINEAR MODELS FOR DEPENDENT DATA
gee S-function, version 4.13 modified 98/01/27 (1998)

Model:
Variance to Mean Relation: Binomial
Correlation Structure:     Independent

Call:
gee(formula = data ~ count, id = subject, family = "binomial")

Summary of Residuals:
Min       1Q   Median       3Q      Max
276.6608 310.3817 322.1195 331.3620 357.5969

Coefficients:
Estimate  Naive S.E.   Naive z  Robust S.E.  Robust z
(Intercept) -0.25516680 0.031437649 -8.116599 0.0134033383 -19.03756
count       -0.01055972 0.001244121 -8.487698 0.0002616798 -40.35360

Estimated Scale Parameter:  0.1066564
Number of Iterations:  1

Working Correlation
[,1]
[1,]    1


Does this look correct? And, if I am interpreting it correctly, there is a significant effect of count on the proportion.

-
Welcome to the site. For count data, you should look into poisson regression. In general, the family of models you need to use is determined by the type of dependent variable you have; A continuous DV usually points you toward linear regression. A binary one, toward logistic regression. A count DV, toward poisson or negative binomial regression. This question, and this one be good place to start, even though they might touch on slightly more complicated cases than the one you are dealing with. –  Antoine Vernet Jan 17 '13 at 23:13
Is the actual ratio bounded in any way? –  Dimitriy V. Masterov Jan 17 '13 at 23:16
@AntoineVernet, thank you very much - I'll look into the Poisson and NegBin methods. –  Pseudo_Scientist Jan 17 '13 at 23:18
@DimitriyV.Masterov - Yes, apologies I forgot to mention that the ratio is actually a percentage, so bound from 0 to 1. Forgive my misuse of terminology. Thank you. –  Pseudo_Scientist Jan 17 '13 at 23:19
Do you mean a proportion? In that case, I believe you can use beta regression. –  Dimitriy V. Masterov Jan 17 '13 at 23:25