Calculate marginal frequencies and marginal relative frequencies from a two-way table or raw categorical data, or solve for a missing total or proportion.

Blank table cells count as zero.

Optional settings

Calculator Functions

FunctionWhat it doesWhat it requires
Two-way tableFinds every row total, column total and grand total of a two-way table, with each total as a share of the grand totalRequires the number of rows and columns (2 to 5 each) and the count in each cell
Relative frequency from totalsFinds the marginal relative frequency of one row or columnRequires the row or column total and the grand total
Marginal total from relative frequencyFinds a row or column total from its relative frequencyRequires the relative frequency (0 to 1) and the grand total
Grand total from relative frequencyFinds the grand total from one row or column total and its relative frequencyRequires the row or column total and the relative frequency (0 to 1)
Two categorical columns from raw dataBuilds the two-way table from a list of paired categories, then finds its totalsRequires one pair of categories per line

Blank table cells count as zero, and cells can hold counts or weights. Optional settings add row and column labels and show each cell as a proportion or percentage of the grand total, its row total or its column total. The raw data function accepts commas, tabs, semicolons or spaces between the two categories and an optional header row.

Marginal Frequency Formulas

MRF = T ÷ G
MRFMarginal relative frequency, as a proportion from 0 to 1
TMarginal frequency: the total of one row or one column
GGrand total: the sum of every cell in the table

A two-way table counts observations by two categorical variables, one in the rows and one in the columns. The row and column totals are written in the margins of the table, which is where the name comes from, and each one counts a category of one variable without regard to the other [1]. A marginal frequency is one of those totals. A marginal relative frequency is the same total as a share of everything counted.

Two-way table

A survey of 20 people by hair color (rows) and eye color (columns) has row totals of 6, 4, 7 and 3 and column totals of 5, 2, 10 and 3 [1]. Those eight numbers are the marginal frequencies. The 4 redheads are 4 ÷ 20 = 0.20, or 20%, of the people surveyed, which is the marginal relative frequency of that row. The row shares add up to 1, and so do the column shares.

Marginal relative frequency

Marginal relative frequency always divides by the grand total. It differs from the two other relative frequencies a two-way table has [2]. A joint relative frequency is a single cell divided by the grand total. A conditional relative frequency is a single cell divided by its own row or column total: of the 4 redheads, 2 have brown eyes, which is 2 ÷ 4 = 50% of that row [1]. The cell display setting switches between these.

Relative frequency from totals

A row total of 3 in a table with a grand total of 10 has a marginal relative frequency of 3 ÷ 10 = 0.3, or 30%. A row or column total cannot be larger than the grand total.

Marginal total from relative frequency

T = MRF × G

A marginal relative frequency of 0.3 in a table of 10 observations means a total of 0.3 × 10 = 3. A rounded proportion can give a total that is not a whole number.

Grand total from relative frequency

G = T ÷ MRF

A row total of 3 that is 0.3 of the table means a grand total of 3 ÷ 0.3 = 10.

Two categorical columns from raw data

Each line is one observation with its two categories, such as “red, brown”. The first category on a line becomes the row and the second the column, in the order they first appear. The number of lines with a given pair is that cell’s count, and the totals follow from the table as above. Up to 100 different categories are accepted for each variable.

Limits of This Estimate

  • The totals describe the data entered. They do not test whether the two variables are related.
  • Raw data lines are counted once each, with no weights, and a line that does not hold exactly two categories is rejected.
  • Category names must match exactly: “Red” and “red” are counted as two categories.

Sources

  1. Yale University, Department of Statistics, Statistics 101: Categorical Data: two-way tables, row and column totals as marginal distributions, and turning counts into percentages
  2. Common Core State Standards for Mathematics, HSS-ID.B.5: the three kinds of relative frequency in a two-way table