# How to model on rate (percentage) outcome, but with consideration of number of total counts?

I would like to model on a rate outcome, with a number of covariates. I also have the number of counts which generate the rate outcome. Like below:

Good.Egg Bad.Egg Total.Egg   Good.Rate   Covariate1   Covariate2...

2         2        4         0.5           1             22.3
2         1        3         0.66          1             12.1
0         1        1         0             0              8.0
4         2        6         0.666         0              7.5
3         5        8         0.375         1              6.6
2         2        4         0.5           0              18.8
0         2        2         0             1              14.6
1         0        1         1             1              7.0


I would like to fit a model, which looks like

Good.Rate ~ covariate1 + covariate2 +......

And obtain P-values for each covariates.(The P-values will be used for a second step analysis)

I am doing the analysis in R.

Originally I am thinking of a GLM regression with family="binomial", but that does not take the number of counts into consideration. And I also considered beta-binomial regression, but it seems not possible to obtain P-value for each covariate?

My question is:

1. Should I care about the number of the total counts? Say, the good egg rate of 1.0 derived from 1 out of 1 is less "reliable" than a good egg rate of 1.0 derived from 5 out of 5?

2. If the answer to the above question is "yes". Then how do I model the data to achieve my goal (obtain P-value for each single covariate)?

Thank you!

2. Logistic regression (family = binomial(link = "logit")) is the way to go, but instead of making the dependent variable the rate, make it the number of good and bad eggs (i.e., use cbind(Good.Egg, Bad.Egg) on the left-hand side of ~). This is equivalent to recoding the data to have one row for each egg, with the dependent variable being a flag indicating whether the egg is bad or good.