# Estimating a proportion based on two counts

I need to estimate a proportion based on independent measurements of the numerator and the denominator. Both the numerator and denominator are measured as counts.

I know from theory that the proportion must be less than one, but in practice the numerator can be higher than the denominator because both are estimates.

To make it concrete, these are cell counts in pre-treated vs post-treated biological samples. I can measure cells in independent before-treatment and after-treatment samples, but imperfectly, and I know the treatment leads to fewer cells. I want to estimate what proportion of cells survive the treatment (with an appropriate interval to reflect uncertainty).

How could I go about this? My initial thought is a Bayesian negative binomial model with a truncated prior on the treatment effect but it feels like there should be a simpler way!

Edit: An example as requested - usually the post-treatment counts are less than the pre-sample counts, eg 4 cells in 1ml of sample post-treated compare to 10 cells in 1ml pre-treated. In one or two cases I see, say 12 or 15 cells in 1ml treated sample compared to 10 in 1ml of pre-treated sample. (Cells do cluster so I'm not concerned that the treated numbers look high given the theory). I am comparing around 20 treatments to each control if that's useful information!

• Can you give a numerical example, showing the sizes of the counts and typical amounts by which numerator may exceed denominator? May 20 at 14:40
• added an example May 20 at 14:53
• It sounds more like you have units like "cells per mL" than you have a proportion.
– Dave
May 20 at 17:42
• @Dave true I am measuring cells/ml in two sub-samples, but the underlying estimand is a proportion, as its the proportion of cells in the post-treatment sample that survived the treatment. so i'm trying to use these counts/rates to get at that underlying proportion. May 20 at 19:58

## 2 Answers

Comment, maybe not a complete Answer:

You mention counts might be Poisson. Suppose the true rate of a sample before treatment is $$\lambda_{pre} = 13$$ and the true rate after treatment is $$\lambda_{post} = 10.$$ Then the probability of a higher count after treatment is about $$1/4.$$ (Simulation below based on 100,000 hypothetical samples.)

set.seed(2021)
pre = rpois(10^5, 13)
mean(pre)
[1] 13.00925   # near 13
post = rpois(10^5, 10)
mean(post)
[1] 9.99841    # near 10

mean(post > pre)
[1] 0.23089    # aprx P(Post > Pre)


Put another way, quantiles .05 and .95 of $$\mathsf{Pois}(13)$$ $$[7$$ and $$19,$$ respectively] are not a lot different from quantiles .05 and .95 of $$\mathsf{Pois}(10),$$ [5 and 15]. (Both Poisson distributions put a lot of probability between 7 and 15.)

qpois(c(.05,.95), 13)
[1]  7 19
qpois(c(.05,.95), 10)
[1]  5 15


A plot of the two Poisson PDFs is shown below.

A speculative Bayesian prior distribution could be chosen to have the effect of substantially ignoring 'reverse' counts, but that would not improve the relatively poor information available from comparing Poisson counts.

I don't yet have a sufficiently good grasp of the context of your comparisons to make a responsible recommendation.

(a) If your goal is to show that treatment tends in the direction of decreased counts, then a (highly-random) Poisson model might be able to detect a meaningful decrease overall.

Suppose the overall rates are $$\lambda_{pre}=13, \lambda_{post}=10$$ throughout a group of $$n=12$$ subjects and that group averages before and after treatment are compared. Then the probability is about 98% that there will be a positive decrease from average before to average after. (Even though some individual patients may not have shown decreases.)

set.seed(520)
a.dec = replicate(10^5, mean(rpois(12,13)) - mean(rpois(12,10)))
mean(a.dec > 0)
[1] 0.98395


(b) However, if your goal is to say whether treatment has truly decreased the rate for a particular patient, I don't think your method as described is adequate.

Note: R code for first figure:

x = 0:30;  PDF = dpois(x,13)
pdf = dpois(x,10)
hdr = "PDFs of POIS(13) [blue] and POIS(10)"
plot(x-.1, PDF, type="h", xlab="x", ylim=c(0,.14), lwd=2,
col="blue", main=hdr)
lines(x+.2, pdf, type="h", col="brown")
abline(h=0, col="green2")
abline(v=0, col="green2")

• Thanks. My goal is the former, but maybe even less ambitious I'm just trying to put a reasonable bound on what the treatment effect might be. I know it's going to be vague! Also I didn't mention I do have some replicates so its not as hopeless as it might seem. May 20 at 20:01
• Good. Then in my simulation for (a), R code quantile(a.dec, c(.025, .975)) gives an approximate 95% confidence interval $(0.33, 5.67)$ on the avg decrease. Centered at $3.0.$ // Time for grocery shopping here. May 20 at 20:15

I do have some experience with this type of data, so I'd suggest a couple of things to implement BruceET's elaboration on Poisson statistics (+1).

First, don't model ratios. Model counts. Model counts as close to the raw data as possible. If you're doing things like hemacytometer counts, model the actual counts, not the transformations to counts per ml.

Second, have a separate data line for each observed count value, annotated with all of the associated values of interest. Obviously you include the treatment type; structure it as a multi-level categorical variable with "control" as the reference level. Also include in each data line anything else that might matter: date of experiment if there is substantial inter-day variability, an indicator of which observations are paired if that's the case, drug concentrations if some of your "treatments" are the same drug at different concentrations, etc. If your cell counts come from different volumes of cell suspensions, include the volume value too.

Third, start with a Poisson regression generalized linear model. That makes sure that the error estimates are properly based on Poisson statistics (variance equals mean). Include the treatment predictor and any other variables that might be of interest. If volumes of the cell suspensions differed and you are interested in differences in cell numbers, use the log of the volume as an offset in the model (fixed to have a slope of 1).

Then (with standard treatment/dummy coding) each coefficient reported for the categorical treatment variable will represent the log difference between a corresponding treatment and control, taking into account any other predictors in your model. That is precisely the log of the ratio that you wish to estimate. It won't matter if in some cases, contrary to expectation, you find more cells in treatment than in control; it will effectively average out over the replicates. (Or not, if a treatment doesn't affect cell count.)

You might find that the Poisson model doesn't work well, in that estimated means and variances are too far apart. Then there are related regression approaches, allowing for a Poisson-like model with variance at some fixed multiple of the mean to be estimated from the data (quasipoisson) or modeling directly with a negative binomial distribution instead. The data set-up and modeling principles, however, would be the same.