Tutorials › Generalized Linear Models › Success-Failure Tables as Binomial Data

Grouped Binomial Regression · Tutorial 387 of 981

Success-Failure Tables as Binomial Data

Learn how a success-failure record represents a binomial outcome, and how its counts, proportion, and covariates play distinct roles.

Intermediate 9 min read

What You'll Learn

  • Define a grouped-binomial record using successes, failures, and the trial total
  • Distinguish the observed success proportion from the random success count
  • Identify what a binomial model assumes about a group’s probability and trial total
  • Separate outcome counts from the group’s explanatory covariates
  • Verify count-table identities and derive the mean and variance of a group proportion

From a Success-Failure Table to a Binomial Record

A grouped-binomial data set describes outcomes in batches. For each group, the table records how many trials ended in success and how many ended in failure. Those are counts; their sum is the number of trials. The observed success proportion is a different quantity, calculated from the counts. Keeping these distinctions clear is essential: a count, a proportion, and a group’s covariates do not play interchangeable roles in a model.

For example, a clinic might report that 18 of 30 patients responded to a treatment. The successes are 18, the failures are 12, the trial total is 30, and the observed success proportion is \(18/30=0.6\). The proportion summarizes the observed outcome, while the counts specify how many trials produced each outcome.

Definition: A grouped-binomial record for group \(i\) consists of a success count \(y_i\), a failure count \(f_i\), a trial total \(n_i\), and a group covariate vector \(x_i\), with \(y_i\) and \(f_i\) nonnegative integers and \(n_i=y_i+f_i\). When \(n_i>0\), the observed success proportion is \(\hat p_i=y_i/n_i\). Under a binomial model, the random success count \(Y_i\) has distribution \(\operatorname{Binomial}(n_i,p_i)\), where \(p_i\) is the group’s success probability. The observed count is a realization \(y_i\) of \(Y_i\); the covariates \(x_i\) describe the group and are not outcome counts.

The symbol \(Y_i\) denotes a random variable before the outcome is observed; \(y_i\) denotes the observed value. In contrast, \(n_i\) is the number of trials recorded for that group. In the ordinary grouped-binomial setup, it is given by the design or data collection, not calculated as a random outcome count. The group probability \(p_i\) is a model quantity, while \(y_i/n_i\) is the observed proportion. These values need not be equal.

A covariate vector \(x_i\) may contain, for instance, a treatment indicator, a group’s mean age, or a measured environmental condition. It identifies characteristics associated with the group. It is not part of the success-failure total, and its entries need not be counts or proportions. In a regression model, the probability \(p_i\) may depend on \(x_i\); the grouped record itself only says what was observed and which covariates were recorded.

What the Binomial Model Says

For a specified trial total \(n_i\) and success probability \(p_i\), the binomial distribution assigns probabilities to the possible success counts \(0,1,\ldots,n_i\):

$$ P(Y_i=k)=\binom{n_i}{k}p_i^k(1-p_i)^{n_i-k}, \qquad k=0,1,\ldots,n_i. $$

Here \(p_i\) lies between 0 and 1. The model treats the trials represented by a group as having the same success probability \(p_i\), with the binomial count distribution. Thus the model’s outcome is the number of successes, not the proportion itself. The proportion is obtained afterward by dividing the count by the trial total.

A success-failure table can display the three linked quantities directly. The success count and failure count are both necessary to state the observed table, while the total and the success count determine the observed proportion whenever the total is positive.

GroupSuccesses \(y_i\)Failures \(f_i\)Total \(n_i\)Observed proportion \(y_i/n_i\)Covariate \(x_i\)
A1812300.60Standard care
B2416400.60New treatment

Both groups have the same observed proportion, but their records are not identical: their success counts, failure counts, and totals differ. The covariate labels are separate from those quantities. A table that gives only the proportions would omit the group totals, so it would not fully state these success-failure records.

Worked Example: Completing a Success-Failure Record

A study reports that 27 of 45 participants in a group experienced symptom relief. The recorded group covariate is the mean baseline symptom score, 6.2. Find the success count, failure count, trial total, and observed success proportion.

The success count is the number who experienced relief: \(y_i=27\). The trial total is the number of participants: \(n_i=45\). Therefore the failure count is \(f_i=n_i-y_i=45-27=18\).

The observed success proportion is \(\hat p_i=y_i/n_i=27/45=0.6\). The resulting record has 27 successes and 18 failures among 45 trials, with group covariate value \(x_i=6.2\). The value 6.2 is not a success count, failure count, or trial total; it describes a measured characteristic of the group.

Worked Example: Distinguishing Count and Proportion

Group A has 12 successes and 8 failures. Group B has 30 successes and 20 failures. Calculate each total and observed success proportion, then identify which quantities match.

For Group A, \(n_A=12+8=20\), so its observed proportion is \(12/20=0.6\).

For Group B, \(n_B=30+20=50\), so its observed proportion is \(30/50=0.6\).

The observed proportions match, but the successes, failures, and totals do not: \(12\ne30\), \(8\ne20\), and \(20\ne50\). A proportion is a ratio formed from the counts; it is not a substitute for listing those counts when the grouped record is being specified.

Two Useful Consequences of the Record Definition

The count table has a simple bookkeeping structure: once the success count and total are known, the failure count is determined. Equivalently, the success-failure pair determines the total and the observed proportion when the total is nonzero.

Result: The correspondence between a valid success-failure pair \((y_i,f_i)\) and the pair \((n_i,y_i)\), where \(n_i=y_i+f_i\), is one-to-one for nonnegative integer counts. If \(n_i>0\), the observed success proportion is then uniquely determined as \(y_i/n_i\).

To verify the claim, start with nonnegative integer counts \((y_i,f_i)\). Set \(n_i=y_i+f_i\); then \(0\le y_i\le n_i\). Conversely, from nonnegative integer values \((n_i,y_i)\) satisfying \(0\le y_i\le n_i\), recover \(f_i=n_i-y_i\), which is a nonnegative integer. These two operations undo one another:

$$ n_i-y_i=(y_i+f_i)-y_i=f_i, \qquad y_i+(n_i-y_i)=n_i. $$

Thus neither representation loses count information. If \(n_i>0\), division gives the uniquely defined observed proportion \(y_i/n_i\). If \(n_i=0\), the only possible counts are \(y_i=f_i=0\), but \(y_i/n_i\) is undefined; a zero-trial record has no observed success proportion. This is why the positive-total condition matters whenever proportions are reported.

Worked Example: Recovering the Missing Entry

A row in a table reports 14 successes and a total of 22 trials. Recover the failure count and observed proportion, and check that the entries form a valid record.

The failure count is \(f_i=n_i-y_i=22-14=8\). It is a nonnegative integer, and the counts add back to the reported total: \(14+8=22\). The observed success proportion is \(14/22=7/11\), approximately \(0.636\). The row is valid because the success count is between zero and the total, and the failure count completes the total.

The Random Count and the Random Proportion

The observed proportion \(y_i/n_i\) is a number calculated from the realized data. Before observing the outcomes, its random counterpart is \(Y_i/n_i\), for a positive fixed total \(n_i\). Under the binomial model, the expected value and variance of this random proportion follow from those of the count.

Result: If \(Y_i\sim\operatorname{Binomial}(n_i,p_i)\) with \(n_i>0\), then \(E[Y_i/n_i]=p_i\) and \(\operatorname{Var}(Y_i/n_i)=p_i(1-p_i)/n_i\).

Here is a direct derivation. Write \(n=n_i\), \(p=p_i\), and \(Y=Y_i\). For \(0<p<1\), the binomial probability mass function gives \(P(Y=k)=\binom{n}{k}p^k(1-p)^{n-k}\). Using \(k\binom{n}{k}=n\binom{n-1}{k-1}\), we obtain

$$ \begin{aligned} E[Y] &=\sum_{k=1}^{n} k\binom{n}{k}p^k(1-p)^{n-k}\\ &=np\sum_{k=1}^{n}\binom{n-1}{k-1}p^{k-1}(1-p)^{(n-1)-(k-1)}\\ &=np. \end{aligned} $$

The last sum equals 1 by the binomial theorem. For the second factorial moment, the identity \(k(k-1)\binom{n}{k}=n(n-1)\binom{n-2}{k-2}\) gives, when \(n\ge2\),

$$ E[Y(Y-1)] =n(n-1)p^2 \sum_{k=2}^{n}\binom{n-2}{k-2}p^{k-2}(1-p)^{(n-2)-(k-2)} =n(n-1)p^2. $$

For \(n=1\), \(Y(Y-1)=0\) always, and the same formula gives zero. Since \(Y^2=Y(Y-1)+Y\), it follows that \(E[Y^2]=n(n-1)p^2+np\). Therefore

$$ \operatorname{Var}(Y) =E[Y^2]-(E[Y])^2 =n(n-1)p^2+np-n^2p^2 =np(1-p). $$

For \(p=0\) or \(p=1\), the binomial count is constant at 0 or \(n\), respectively, so the same expectation and variance formulas hold directly. Finally, division by the fixed positive \(n\) yields

$$ E\left[\frac{Y}{n}\right]=\frac{E[Y]}{n}=p, \qquad \operatorname{Var}\left(\frac{Y}{n}\right) =\frac{\operatorname{Var}(Y)}{n^2} =\frac{p(1-p)}{n}. $$

The expectation statement concerns the random proportion across repetitions under the model. It does not say that a particular observed proportion must equal \(p_i\). For an actual record, \(y_i/n_i\) is fixed once the data have been collected; \(p_i\) describes the probability model for the group.

Common Mistakes and a Practical Check

A frequent error is to write the observed proportion in place of the count and then treat it as though it were the observed number of successes. The ratio \(y_i/n_i\) cannot reveal both counts unless the total is also known. For example, the proportion \(0.6\) could come from 3 successes out of 5 trials, 12 out of 20, or many other records.

Another mistake is to include covariates in the success-failure arithmetic. A group’s mean age or treatment category may help describe how its probability varies, but neither is added to the successes or failures. Keep the record organized into separate roles: \(y_i\) and \(f_i\) are outcome counts, \(n_i\) is their total, \(\hat p_i\) is their observed ratio when \(n_i>0\), and \(x_i\) contains group descriptors.

1
Check the counts.
Confirm that successes and failures are nonnegative integers and add to the reported trial total.
2
Calculate the proportion only when defined.
If the total is positive, divide successes by the total. If the total is zero, there is no observed proportion.
3
Keep the covariates separate.
Record group characteristics as predictors or descriptors, not as components of the outcome count.

These distinctions provide a reliable starting point for grouped-binomial analysis. The data row describes counts and group characteristics; the binomial model describes the probability distribution of the random success count. Its observed proportion is a useful summary, but it remains a derived quantity rather than the underlying count record.

Check Your Understanding

Use the definitions and results above to answer the following.

  1. A group has 19 successes among 32 trials. What is its failure count and observed success proportion?
  2. Explain the difference between the random count \(Y_i\) and its observed value \(y_i\).
  3. A table reports a success proportion of 0.75 but gives no trial total. Can you recover the success and failure counts? Explain.
  4. What happens to the observed-proportion definition when a group has zero trials?
  5. Under a binomial model with positive trial total, what are the mean and variance of the random success proportion \(Y_i/n_i\)?
  6. A group’s covariate is its mean baseline score. Explain why that value is not part of the success-failure total.
Clinical Biostats