Tutorials › Introduction to Statistics › Representing Two-Group Data With Counts and Proportions

Two-Proportion Inference · Tutorial 699 of 996

Representing Two-Group Data With Counts and Proportions

Represent outcomes from two groups clearly by defining success, recording each group’s denominator and counts, and calculating its sample proportion.

Intermediate 9 min read

What You'll Learn

  • Define and record success consistently across two groups.
  • Translate between sample size, success count, failure count, and sample proportion.
  • Keep each group’s denominator attached to its count and percentage.
  • Convert percentages and rounded rates back to counts carefully.
  • Distinguish the proportion within each group from the combined proportion.
  • Organize two-group outcomes in a clear comparison table.

Why Counts and Proportions Belong Together

A comparison between two groups often begins with a yes-or-no outcome: whether a patient experienced a side effect, whether a respondent supports a proposal, or whether a product failed inspection. To describe such data clearly, we need more than two percentages. We need to know how many individuals were observed in each group, how many had the outcome of interest, and how those counts relate to the group sizes.

A percentage without its denominator can be misleading. For instance, 20% could describe 2 of 10 people or 200 of 1,000 people. The percentages match, but the observed amounts of information differ. This tutorial develops a consistent way to represent two-group data before any statistical inference is considered.

Definition: For group \(i\), let \(n_i\) be its sample size, \(x_i\) its number of successes, and \(n_i-x_i\) its number of failures. The sample proportion of successes is \(\hat{p}_i=x_i/n_i\). Thus \(n_i=x_i+(n_i-x_i)\), and \(0\leq x_i\leq n_i\). The labels “success” and “failure” are bookkeeping terms for the two possible outcomes; success means the outcome selected for counting, not necessarily a desirable result.

The subscript \(i\) identifies a group. For two groups, we can use \(i=1\) and \(i=2\), but the labels must be tied to their meanings in context. For example, group 1 might be patients receiving a new treatment and group 2 patients receiving usual care. A complete record therefore includes the group name as well as \(n_i\), \(x_i\), the failure count, and \(\hat{p}_i\).

Building the Representation

Start by specifying the outcome that will count as a success. Then count the individuals with that outcome in each group. The remaining individuals are failures for this particular outcome. Finally, divide the success count by the sample size for that same group.

1
Name the groups and outcome.
State which group each row represents and exactly what qualifies as a success, including the relevant time period when one matters.
2
Record the denominator and counts.
For each group, write its sample size \(n_i\), success count \(x_i\), and failure count \(n_i-x_i\). Check that the two counts sum to the sample size.
3
Calculate and label the sample proportion.
Use \(\hat{p}_i=x_i/n_i\). If reporting a percentage, multiply by 100 and retain the denominator in the table or explanation.

A two-row table makes the structure visible. The sample proportion describes the share of the observed group with the selected outcome. It is not a count, and it is not the proportion in some other group. Keeping all columns together makes it easier to spot mismatched denominators or arithmetic errors.

GroupSample sizeSuccessesFailuresSample proportion of successes
Group 1\(n_1\)\(x_1\)\(n_1-x_1\)\(\hat{p}_1=x_1/n_1\)
Group 2\(n_2\)\(x_2\)\(n_2-x_2\)\(\hat{p}_2=x_2/n_2\)

Worked Example: Recording a Health Outcome

Suppose, in a hypothetical health study, 120 patients receiving Treatment A and 100 patients receiving usual care are followed for 30 days. The outcome is at least one reported headache during follow-up. There are 18 such patients in Treatment A and 22 in usual care. Represent the data with counts and proportions.

The groups are Treatment A and usual care. Define a success as a patient reporting at least one headache during the 30-day period. The number of failures is the number who did not report a headache.

For Treatment A, \(n_1=120\) and \(x_1=18\). Its failure count is \(120-18=102\), and its sample proportion is

$$ \hat{p}_1=\frac{x_1}{n_1}=\frac{18}{120}=0.15=15\%. $$

For usual care, \(n_2=100\) and \(x_2=22\). Its failure count is \(100-22=78\), and its sample proportion is

$$ \hat{p}_2=\frac{x_2}{n_2}=\frac{22}{100}=0.22=22\%. $$

The completed rows are therefore Treatment A: 120 patients, 18 successes, 102 failures, and a sample proportion of 0.15; usual care: 100 patients, 22 successes, 78 failures, and a sample proportion of 0.22. These are descriptions of the hypothetical observed groups. Recording them does not, by itself, establish why the proportions differ.

Proportions, Percentages, and Their Denominators

A proportion is a fraction whose denominator is the number of individuals in the group being described. It ranges from 0 to 1. A percentage is the same quantity expressed on a 0-to-100 scale: \(100\hat{p}_i\%\). For example, a sample proportion of 0.08 is 8%. The unitless fraction and its percentage convey the same rate, but a count such as 8 successes does not convey a rate until its denominator is known.

If a percentage and sample size are given, the success count is recovered by multiplying the proportion by the sample size. A reported percentage may have been rounded, so this product may not be an exact integer. In that case, use the original count if available, or explain that a count inferred from the rounded percentage is approximate. Do not silently treat an approximate calculation as an exact observed count.

Worked Example: Translating a Survey Percentage Into Counts

In a hypothetical survey, 240 randomly selected residents are asked whether they support a local park proposal. Suppose 37.5% answer yes. Find the number of yes responses, the number of no responses, and the sample proportion of yes responses.

Here \(n=240\), and success means answering yes. Convert the percentage to a proportion by dividing by 100: \(37.5\%=0.375\). Multiplying by the sample size gives the success count:

$$ x=n\hat{p}=240(0.375)=90. $$

The failure count is \(240-90=150\). Checking the proportion from the count gives

$$ \hat{p}=\frac{x}{n}=\frac{90}{240}=0.375=37.5\%. $$

Thus the survey recorded 90 yes responses and 150 no responses among 240 residents. Because this percentage produces an integer count, the conversion is exact here. The denominator remains 240; 37.5% does not mean that 37.5 people responded yes.

The proportion for each group must use that group’s own denominator. If the groups have different sample sizes, taking the ordinary average of their two sample proportions generally does not give the proportion among everyone combined. The combined proportion is calculated from the total successes divided by the total sample size.

$$ \hat{p}_{\mathrm{combined}} = \frac{x_1+x_2}{n_1+n_2} = \frac{n_1\hat{p}_1+n_2\hat{p}_2}{n_1+n_2}. $$

This formula follows by adding the groups’ success counts and their sample sizes. Since \(x_i=n_i\hat{p}_i\), the total success count is \(n_1\hat{p}_1+n_2\hat{p}_2\); dividing by the combined denominator \(n_1+n_2\) gives the stated result. The formula is an arithmetic description of the combined records, not a replacement for reporting each group separately.

Worked Example: Finding the Combined Proportion Without Losing Group Sizes

Consider a hypothetical survey in which 30 of 50 people in Group A and 42 of 150 people in Group B select a particular answer. Find each group’s sample proportion and the proportion among all respondents combined.

For Group A, \(n_1=50\), \(x_1=30\), and the failure count is \(50-30=20\). Its sample proportion is

$$ \hat{p}_1=\frac{30}{50}=0.60=60\%. $$

For Group B, \(n_2=150\), \(x_2=42\), and the failure count is \(150-42=108\). Its sample proportion is

$$ \hat{p}_2=\frac{42}{150}=0.28=28\%. $$

Across both groups there are \(30+42=72\) successes among \(50+150=200\) respondents. Therefore,

$$ \hat{p}_{\mathrm{combined}}=\frac{72}{200}=0.36=36\%. $$

The unweighted average of the two group proportions would be \((0.60+0.28)/2=0.44\), or 44%, which is not the combined proportion. It gives equal weight to the two group rates even though Group A has 50 people and Group B has 150. The correct combined proportion gives each respondent equal weight through the total-count calculation.

Keeping the Outcome and Group Labels Clear

The word “success” depends on the question. In a study of infection, success might be defined as developing an infection; in a study of vaccination, it might instead be defined as receiving the vaccine. Neither label is universally correct. State the outcome in ordinary language so a reader can tell what \(x_i\) counts. If it helps prevent confusion, use a more descriptive column heading such as “reported headache” rather than simply “successes.”

Also state whether the outcome is measured once per individual and specify the period or rule used to classify it when relevant. If a person could be counted multiple times, a simple success count may no longer represent the number of individuals with the outcome. The table in this tutorial treats each individual as contributing one binary classification for the outcome being summarized.

Group labels matter just as much. “Group 1” and “Group 2” are convenient symbols, but the written description should say what they mean. Keeping the same ordering throughout a table, calculation, and explanation prevents accidentally attaching a proportion to the wrong group.

Common Mistakes

  • Reporting a percentage without its denominator. “The rate was 20%” leaves unclear whether that means 2 of 10 or 200 of 1,000. Give the count and sample size alongside the percentage.
  • Using the wrong group’s sample size. Calculate \(\hat{p}_i=x_i/n_i\) with the success count and denominator from the same group. Do not divide Treatment A’s successes by the total number of participants unless you are calculating a combined proportion.
  • Confusing a proportion with a count. A proportion of 0.25 means one quarter of the group, not 0.25 individuals. The corresponding count is \(0.25n_i\), when the given information supports an exact count.
  • Assuming the success label means a favorable outcome. The label only identifies the outcome being counted. State what it means in context, especially when the outcome is adverse.
  • Averaging group percentages to describe everyone combined. This is generally wrong when group sizes differ. Add the success counts and divide by the combined sample size.
Key takeaway: For each group, report the group name, sample size, success count, failure count, and sample proportion. These quantities are linked by \(n_i=x_i+(n_i-x_i)\) and \(\hat{p}_i=x_i/n_i\); preserving the denominator is essential for an accurate comparison.

Check Your Understanding

Use the definitions and calculations above to answer each question.

  1. A hypothetical group has 80 participants, of whom 12 meet a defined outcome. What are the success count, failure count, and sample proportion?
  2. A report says that 15% of 200 survey respondents selected “yes.” How many selected “yes,” and how many did not?
  3. Two groups have sample sizes 40 and 160, with sample proportions 0.50 and 0.25. Calculate the combined proportion from the group sizes and rates.
  4. Why is “24% experienced the outcome” incomplete if no sample size or count is provided?
  5. In a health example, “success” is defined as experiencing a side effect. Explain why that definition is valid for counting even though the outcome may be undesirable.