Written and maintained by CASRAI Editorial Board
Last updated
Marginal probability is the probability of one event on its own, ignoring every other variable in the data. To calculate it from a table of counts, divide the row or column total for that event by the grand total. To calculate it from a joint probability table, add the joint probabilities across the values of the other variable. This guide shows both routes with the same arithmetic you can check by hand, then covers the relative frequency marginal distribution, reporting and code.
What is marginal probability?
A marginal probability is the probability of a single event A, written P(A), computed without reference to any other event or variable. The name comes from where it is found in a two-way table: the totals written in the margins. As the Statistics LibreTexts ADAPT chapter puts it, a probability computed using only the totals in the margins of the table is a marginal probability. The full set of marginal probabilities for one variable is its marginal distribution.
Marginal probability answers “how likely is this outcome overall?” It differs from a joint probability (two events together) and from a conditional probability (one event given that another has happened). The comparison table below puts all three on one data set.
How to calculate marginal probability (formula)
From a table of counts
Use the classical ratio from the LibreTexts chapter: the number of ways event A can happen divided by the total number of outcomes. In a two-way table the numerator is a row total or a column total, and the denominator is the grand total.
P(A) = n(A) / N
- P(A): the marginal probability of event A (or the marginal relative frequency, when the table holds sample data).
- n(A): the row total or column total for the category A, which is the sum of the cell counts across the other variable.
- N: the grand total, the count of every observation in the table.
From a joint probability table
When the table already holds joint probabilities p(x, y) rather than counts, sum over the values of the other variable. For a discrete variable X with a second variable Y, the marginal probability is:
pX(xi) = Σj p(xi, yj)
- pX(xi): the marginal probability that X takes the value xi.
- p(xi, yj): the joint probability that X = xi and Y = yj at the same time.
- Σj: add over every value yj that Y can take, one cell per value.
Both forms are the same operation. A count table divided by N is a joint probability table, so summing a row of counts and then dividing by N gives the same number as summing the row of joint probabilities.
Worked example from a two-way table
This example uses the handedness table from OpenStax Introductory Statistics 2e (section 3.1, Example 3.3): 100 people classified by sex assigned at birth and by dominant hand. The marginal totals below are our own arithmetic from the four cell counts.
| Sex | Right-handed | Left-handed | Row total |
|---|---|---|---|
| Male | 43 | 9 | 43 + 9 = 52 |
| Female | 44 | 4 | 44 + 4 = 48 |
| Column total | 43 + 44 = 87 | 9 + 4 = 13 | N = 100 |
Step 1. Find the grand total: 52 + 48 = 100, and 87 + 13 = 100. The two must agree before you go on.
Step 2. Divide the margin total of interest by the grand total.
- P(male) = 52 / 100 = 0.52
- P(female) = 48 / 100 = 0.48
- P(right-handed) = 87 / 100 = 0.87
- P(left-handed) = 13 / 100 = 0.13
Step 3. Check that each variable’s marginals sum to 1: 0.52 + 0.48 = 1.00 and 0.87 + 0.13 = 1.00.
The same calculation from a joint probability table
Suppose the joint probabilities for two discrete variables are given directly. This table is a constructed illustration, not data from a study. X takes the values 0, 1 and 2; Y takes the values 0 and 1.
| Y = 0 | Y = 1 | pX(x) | |
|---|---|---|---|
| X = 0 | 0.10 | 0.20 | 0.10 + 0.20 = 0.30 |
| X = 1 | 0.15 | 0.25 | 0.15 + 0.25 = 0.40 |
| X = 2 | 0.20 | 0.10 | 0.20 + 0.10 = 0.30 |
| pY(y) | 0.10 + 0.15 + 0.20 = 0.45 | 0.20 + 0.25 + 0.10 = 0.55 | 1.00 |
The marginal distribution of X is 0.30, 0.40, 0.30 and that of Y is 0.45, 0.55. Each sums to 1, and so does the whole table.
How to find the relative frequency marginal distribution
A marginal relative frequency is a margin count divided by the grand total. Listing all of them for one variable gives its relative frequency marginal distribution. From the handedness table:
| Variable | Category | Margin count | Relative frequency (count / 100) |
|---|---|---|---|
| Sex | Male | 52 | 0.52 |
| Sex | Female | 48 | 0.48 |
| Dominant hand | Right-handed | 87 | 0.87 |
| Dominant hand | Left-handed | 13 | 0.13 |
Each variable’s column of relative frequencies adds to 1. When the table comes from a sample, these figures are estimates of the population probabilities, not the population values themselves. For a full treatment of frequency tables see interpreting a frequency distribution table.
Interpretation: what the result means
A marginal probability of 0.87 for right-handedness means that if you pick one of the 100 people at random, the chance the person is right-handed is 0.87, whatever their sex. Use this reading guide to avoid mixing up the three kinds of probability, all computed from the same table:
| Quantity | Question it answers | Calculation here | Result |
|---|---|---|---|
| Marginal, P(R) | How likely is right-handed overall? | 87 / 100 | 0.87 |
| Joint, P(M and R) | How likely is a person who is both male and right-handed? | 43 / 100 | 0.43 |
| Conditional, P(R | M) | Among males only, how likely is right-handed? | 43 / 52 | 0.827 |
The marginal probability uses a total from a margin over the grand total. The joint probability uses one cell. The conditional probability changes the denominator to a single row or column total.
Assumptions and common mistakes
- Every observation sits in exactly one cell. Categories must not overlap and must cover all cases, otherwise row totals will not add to N.
- Dividing by a row total instead of the grand total. 43 / 52 = 0.827 is a conditional probability, not P(R). The marginal is 87 / 100 = 0.87.
- Using a cell instead of a margin. 43 / 100 = 0.43 is the joint probability of male and right-handed.
- Forgetting to sum the other variable out. A marginal probability needs the whole row or column added together first.
- Treating a sample marginal as the population value. Relative frequencies from a sample carry sampling error; the table alone cannot tell you how much.
- Assuming marginals determine the joint distribution. Different joint tables can share the same margins, so you cannot rebuild the cells from the totals alone. Whether two events are independent is a separate question; the chi-squared worked examples show a test for it.
How to report it (APA example)
State the count, the total and the proportion, and say that it is a marginal (overall) figure. For example: “Of the 100 participants, 87 were right-handed (marginal proportion = .87) and 13 were left-handed (.13).” APA style omits the leading zero for values that cannot exceed 1, such as proportions and probabilities. If the table is the main result, give the full two-way table with its totals instead of repeating each figure in the text.
How to calculate it in Excel, R or Python
The logic is the same in each tool: total the margin, then divide by the grand total. The Python version was run on the handedness counts above and returns 0.52, 0.48 for sex and 0.87, 0.13 for hand.
Excel
Put the counts in B2:C3 (rows male and female, columns right and left). The marginal probability of right-handed is the column total over the grand total:
=SUM(B2:B3)/SUM(B2:C3)
For male, use =SUM(B2:C2)/SUM(B2:C3). A PivotTable with counts shown as percent of grand total gives the margins directly; see crosstabs in Excel.
R
m = matrix(c(43, 9, 44, 4), nrow = 2, byrow = TRUE,
dimnames = list(sex = c("Male", "Female"),
hand = c("Right", "Left")))
prop.table(margin.table(m, 1)) # marginal distribution of sex
prop.table(margin.table(m, 2)) # marginal distribution of hand
More table functions are covered in crosstabs in R.
Python
import pandas as pd
df = pd.DataFrame({"Right": [43, 44], "Left": [9, 4]},
index=["Male", "Female"])
n = df.values.sum()
print(df.sum(axis=1) / n) # marginal distribution of sex
print(df.sum(axis=0) / n) # marginal distribution of hand
FAQ
How to calculate marginal probability?
Add up the row or column that holds your event, then divide by the grand total of the table. In the example, P(right-handed) = (43 + 44) / 100 = 0.87. If you start from joint probabilities, add the joint probabilities across the other variable instead.
What is marginal probability?
It is the probability of a single event or variable value considered on its own, ignoring all other variables. It is called marginal because it is found from the totals in the margins of a two-way table.
How to find the relative frequency marginal distribution?
Divide every row total (or column total) by the grand total. The resulting list, such as 0.52 and 0.48 for sex, is the relative frequency marginal distribution, and it always sums to 1.
Is marginal probability the same as conditional probability?
No. A conditional probability restricts attention to one row or column and divides by that total (43 / 52 = 0.827 for right-handed among males). A marginal probability divides by the grand total (0.87).
Do marginal probabilities always sum to 1?
Yes, for one variable, provided the categories are mutually exclusive and cover every case: 0.52 + 0.48 = 1 and 0.87 + 0.13 = 1.
Sources
- OpenStax, Introductory Statistics 2e, section 3.1 Terminology (notation P(A) and the handedness table of Example 3.3): https://openstax.org/books/introductory-statistics-2e/pages/3-1-terminology. Date checked: 2026-10-29.
- Seidler-Wright, H., ADAPT Statistics, section 3.02 Marginal, Joint and Conditional Probability, Statistics LibreTexts (CC BY-NC-SA 4.0): https://stats.libretexts.org/Workbench/ADAPT_Statistics_book/03%3A_Probability/3.02%3A_Marginal_Joint_and_Conditional_Probability. Date checked: 2026-10-29.
- Wikipedia, “Marginal distribution” (the summation form over a joint distribution; secondary reference): https://en.wikipedia.org/wiki/Marginal_distribution. Date checked: 2026-10-29.








