Cramér's V Calculator

Enter a table of counts, from 2×2 up to 10×10, to get Cramér's V, the bias-corrected V, phi, Tschuprow's T and the contingency coefficient, with the chi-square test behind them and Cohen's small, medium or large label for the size of the association.

For the chi-square test itself, with the expected counts and residuals of every cell, use the chi-square test of independence calculator; for a 2×2 table with small counts, use Fisher's exact test.

Enter the number of observations in each combination of categories: whole counts, not percentages. Add rows or columns for a larger table, up to 10 by 10, or paste a table from a spreadsheet.

Paste a table of counts, one row per line, the counts separated by tabs, commas or spaces. The grid takes the size of the paste, from 2×2 up to 10×10:

How to use the Cramér's V calculator

  1. Enter the observed counts of each combination of categories. The rows are the categories of one variable and the columns the categories of the other. Use whole counts, not percentages.
  2. For a table larger than 2×2 press Add row or Add column, up to 10 by 10, or paste rows from a spreadsheet, then press Calculate Cramér's V.
  3. Read V and its size label first. In a small sample look at the bias-corrected V as well, and use the p-value for the chi-square test of independence that V is built on.

Every row and every column needs at least one observation. V is defined only for categories that occur, so instead of quietly measuring a smaller table than the one you entered, the calculator asks you to remove an empty row or column.

What Cramér's V measures

Cramér's V measures how strongly two categorical variables are associated: how much knowing the category of one tells you about the category of the other. It runs from 0, no association, to 1, complete association, and it is built on the chi-square statistic of the table. The chi-square test tells you whether an association exists; V tells you how strong it is, and unlike the statistic it does not grow with the sample size, which is why it is reported as the effect size of a chi-square test of independence.

χ² = Σ (O − E)² / E, with E = row total × column total / n

φ² = χ² / n

V = √(φ² / min(r − 1, c − 1)) = √(χ² / (n · min(r − 1, c − 1)))

2×2 table: φ = (ad − bc) / √((a + b)(c + d)(a + c)(b + d)), and V = |φ|

Tschuprow's T = √(φ² / √((r − 1)(c − 1)))

Contingency coefficient: C = √(χ² / (χ² + n))

Bias-corrected V: Ṽ = √(φ̃² / min(r̃ − 1, c̃ − 1))

with φ̃² = max(0, φ² − (r − 1)(c − 1) / (n − 1)), r̃ = r − (r − 1)² / (n − 1), c̃ = c − (c − 1)² / (n − 1)

Here r and c are the numbers of rows and columns and n is the total count. Dividing by the smaller of r − 1 and c − 1 is what keeps V between 0 and 1 in a table of any size. V is 1 when each category of the variable with more categories occurs with only one category of the other variable (in a square table, when each category of either variable goes with exactly one category of the other).

How to interpret Cramér's V

Cohen's benchmarks for the effect size w of a chi-square test are 0.1 for a small effect, 0.3 for a medium one and 0.5 for a large one. Because V = w / √df*, where df* is the smaller of r − 1 and c − 1, the values of V that correspond to them get smaller as the table gets bigger:

df* (smaller side − 1)Table sizesSmallMediumLarge
12×2, 2×3, 2×4 and so on0.10.30.5
23×3, 3×4, 3×5 and so on0.0710.2120.354
34×4, 4×5, 4×6 and so on0.0580.1730.289
45×5, 5×6, 5×7 and so on0.050.150.25
56×6, 6×7, 6×8 and so on0.0450.1340.224

A table with 100 people in each of three groups, sorted into three responses as 45, 30, 25 and 20, 35, 45 and 10, 25, 65, has χ² = 45.44 with 4 degrees of freedom (p = 3.2e-9) and V = 0.275. Its smaller side has 3 categories, so df* = 2 and the benchmarks are 0.071, 0.212 and 0.354: the association is medium. Read against 0.1, 0.3 and 0.5 it would look small. The calculator applies the benchmarks for the size of your table and shows them next to the result.

The benchmarks are conventions from the behavioral sciences, not laws of nature. What counts as a strong association depends on the field and on what is at stake, and a small V from a large sample can still matter. The label is worked out from the exact counts, so a table that lies exactly on a benchmark is on its upper side.

Worked example 1: a 2×3 table

Two groups are each sorted into three outcomes: 12, 8 and 4 in group A, and 6, 9 and 7 in group B (use Load example). The row totals are 24 and 22, the column totals 18, 17 and 11, and n = 46. The expected counts are 9.39, 8.87 and 5.74 in group A and 8.61, 8.13 and 5.26 in group B.

  1. Chi-square: χ² = Σ (O − E)² / E = 2.795333 with df = (2 − 1)(3 − 1) = 2, so p = 0.2472.
  2. Phi squared: φ² = 2.795333 / 46 = 0.060768.
  3. V: the smaller side has 2 categories, so df* = 1 and V = √(0.060768 / 1) = 0.2465, a small effect. The p-value is above 0.05, so the data do not rule out independence.
  4. Bias-corrected V: the expected φ² under independence is (2 − 1)(3 − 1) / 45 = 0.044444, so φ̃² = 0.060768 − 0.044444 = 0.016324. The smaller of r̃ − 1 = 0.9778 and c̃ − 1 = 1.9111 is 0.9778, and Ṽ = √(0.016324 / 0.9778) = 0.1292.
  5. Other measures: Tschuprow's T = 0.2073 and the contingency coefficient C = 0.2393.

Worked example 2: phi in a 2×2 table

In a 2×2 table V is the absolute value of phi. Take 49 and 64 in the first row and 44 and 24 in the second, so n = 181, the row totals are 113 and 68 and the column totals 93 and 88. Then ad − bc = 49 × 24 − 64 × 44 = −1,640 and √((a + b)(c + d)(a + c)(b + d)) = √(113 × 68 × 93 × 88) ≈ 7,930.06, so φ = −1,640 / 7,930.06 = −0.2068.

The sign only records the order of the rows and columns: swap the two rows and φ becomes +0.2068, while V = |φ| = 0.2068 stays the same. It is a small effect. The chi-square statistic is n × φ² = 181 × 0.0427696 = 7.7413 with 1 degree of freedom, so p = 0.0054. To describe the direction of an association in a 2×2 table use the odds ratio or the relative risk.

Worked example 3: a small sample and the bias correction

Enter 3 and 1 in the first row and 1 and 3 in the second. Every row and column total is 4, n = 8, φ = (9 − 1) / 16 = 0.5 and χ² = 8 × 0.25 = 2, so V = 0.5, which Cohen's benchmarks call large. The p-value is 0.1573 and every expected count is 2, well below 5.

With only 8 observations even two unrelated variables show a φ² of about (r − 1)(c − 1) / (n − 1) = 1/7 by chance. Taking that off gives φ̃² = 1/4 − 1/7 = 3/28, the smaller of r̃ − 1 and c̃ − 1 is (2 − 1)(8 − 2) / 7 = 6/7, and Ṽ = √((3/28) / (6/7)) = √(1/8) = 0.3536: about 29% smaller than V, and a medium effect rather than a large one.

Bias-corrected V

Cramér's V is calculated from a sample, and a sample of unrelated variables never shows a φ² of exactly 0: it averages about (r − 1)(c − 1) / (n − 1). V therefore overestimates the association in the population, the more so the bigger the table and the smaller the sample. Bergsma (2013) proposed subtracting that expected amount from φ² and shrinking the dimensions of the table in the same spirit, which gives the bias-corrected V above; it is what R's rcompanion::cramerV(bias.correct = TRUE) reports. In a large sample the two agree closely; in a small one report both, or the corrected one.

The correction is undefined when the table has no more observations than rows or columns, for example a 2×2 table of two observations, and the calculator says so rather than showing a number. The size label is based on V, as Cohen's benchmarks are usually applied; take the bias-corrected V as the more conservative estimate.

Cramér's V, phi, Tschuprow's T and the contingency coefficient

MeasureRangeTablesNotes
Phi (φ)−1 to 12×2 onlyEquals (ad − bc) / √((a + b)(c + d)(a + c)(b + d)). Its sign depends on the order of the rows and columns. V = |φ|.
Cramér's V0 to 1Any r×c√(φ² / min(r − 1, c − 1)). The usual effect size for a chi-square test of independence.
Tschuprow's T0 to 1Any r×c√(φ² / √((r − 1)(c − 1))). Equal to V for a square table and smaller than V otherwise, so it cannot reach 1 unless the table is square.
Contingency coefficient C0 to below 1Any r×c√(χ² / (χ² + n)). Its largest value depends on the table: √((k − 1) / k) for k = the smaller side, or 0.707 for 2×2 and 0.816 for 3×3.

Prefer V for reporting, because it can reach 1 in a table of any shape and its benchmarks are established. Use phi for a 2×2 table when you want the direction of the association as well. The contingency coefficient is included because it is still asked for, but two of its values are only comparable when the tables have the same size.

Assumptions and limits

  • Counts of independent observations. Each observation belongs to exactly one cell. For the same subjects measured twice use McNemar's test or Cohen's kappa instead.
  • V is unsigned and treats the categories as unordered. It says how strong the association is, not in which direction, and it ignores any order the categories have. Ordinal measures such as Kendall's tau-b, Goodman and Kruskal's gamma or Somers' D use that order.
  • Small expected counts. The p-value comes from the chi-square approximation, which needs expected counts of about 5 or more; the calculator warns when they are lower. V itself can still be calculated, but it runs high in a small sample.
  • Compare tables of different sizes with care. V is scaled to 1 in every table, but the same V means a bigger effect in a larger table, as the benchmarks above show, and merging or splitting categories changes V.
  • No confidence interval. The calculator gives V as a point estimate; an interval needs a bootstrap or the noncentral chi-square distribution.

Cramér's V in Excel, R, Python and SPSS

ToolHow
Excel / Google SheetsNo built-in function. With the counts in B2:D3 and the expected counts in B7:D8: =SQRT(SUMPRODUCT((B2:D3-B7:D8)^2/B7:D8)/(SUM(B2:D3)*MIN(ROWS(B2:D3)-1,COLUMNS(B2:D3)-1)))
Rrcompanion::cramerV(table) with bias.correct = TRUE for Ṽ; DescTools::CramerV(table); lsr::cramersV(table); vcd::assocstats(table) for V, C and phi
Pythonscipy.stats.contingency.association(table, method="cramer"); method="tschuprow" gives T and method="pearson" gives C. Its correction argument is the Yates continuity correction, not the bias correction, and scipy has no bias-corrected V.
SPSSAnalyze > Descriptive Statistics > Crosstabs > Statistics, then tick Phi and Cramér's V

The chi-square test in Excel guide shows the expected counts and the statistic step by step, and effect size explained puts V next to Cohen's d, r and eta squared.

Common mistakes

  • Entering percentages or proportions. V is worked out from counts, and the chi-square statistic and its p-value depend on how many observations there are.
  • Reading a small p-value as a strong association. With enough observations a tiny association is significant. Look at V.
  • Reading V as a correlation with a sign. V has no direction. Only phi, for a 2×2 table, has a sign, and it flips when two rows are swapped.
  • Using the benchmarks 0.1, 0.3 and 0.5 for a large table. They apply to tables with a side of 2 categories; the calculator uses the benchmarks for your table.
  • Leaving out a category with no observations. If the empty row or column is a real category of the variable, V describes a smaller table than the one you have.

Related guides and calculators

The chi-square test of independence gives the expected counts, residuals and p-value for the same table, and chi-square goodness of fit tests one variable against expected proportions. For 2×2 tables see Fisher's exact test, the odds ratio and the relative risk, and relative risk vs odds ratio explains when each fits. The chi-square test explained and how to read a chi-square table guides cover the test behind V.

Frequently Asked Questions

What is Cramér's V?

Cramér's V is a measure of association between two categorical variables, from 0 (no association) to 1 (complete association). It is calculated from the chi-square statistic of the contingency table, V = √(χ² / (n · min(r − 1, c − 1))), and is the usual effect size for a chi-square test of independence.

How do I calculate Cramér's V?

Work out the chi-square statistic of the table, divide it by the total count n times the smaller of (rows − 1) and (columns − 1), and take the square root. For a table of 46 observations with 2 rows, 3 columns and χ² = 2.7953, V = √(2.7953 / (46 × 1)) = 0.2465. The calculator does this from the counts and shows the working.

What is a good Cramér's V?

By Cohen's conventions, V near 0.1 is a small effect, near 0.3 medium and near 0.5 large in a table with a side of two categories. In larger tables the benchmarks are those values divided by the square root of df*, the smaller side minus 1: 0.071, 0.212 and 0.354 for df* = 2. What counts as strong depends on the field, so treat the labels as a rough guide.

What is the difference between Cramér's V and phi?

Phi is defined only for 2×2 tables and can be negative or positive, depending on the order of the rows and columns. Cramér's V works for any table size and is never negative. In a 2×2 table V is the absolute value of phi, so they measure the same strength.

What is bias-corrected Cramér's V and when should I use it?

Cramér's V overestimates the association in the population, especially in a small sample or a large table. Bergsma's correction subtracts the value of φ² expected by chance, (r − 1)(c − 1) / (n − 1), and shrinks the table dimensions accordingly. Use it, or report both values, when the sample is small; in a large sample the two are nearly equal. It is undefined when there are no more observations than rows or columns.

Does Cramér's V have a p-value?

The p-value shown is that of the Pearson chi-square test of independence for the same table, since V is a rescaling of the chi-square statistic. It needs expected counts of about 5 or more to be reliable, and the calculator warns when they are lower. The p-value tells you whether there is evidence of an association and V tells you how strong it is.

Can Cramér's V be negative?

No. V is between 0 and 1 and has no direction. Only phi, for a 2×2 table, has a sign, and the sign depends on which category is listed first in the rows and columns. To describe the direction of an association in a 2×2 table use the odds ratio or the relative risk.

What are Tschuprow's T and the contingency coefficient?

They are two other rescalings of the chi-square statistic. Tschuprow's T equals V for a square table and is smaller otherwise. The contingency coefficient C = √(χ² / (χ² + n)) can never reach 1: its largest value is √((k − 1) / k), where k is the smaller side of the table, so 0.707 for a 2×2 table. V is the one most often reported.

How do I calculate Cramér's V in Excel, R or Python?

Excel has no function for it: compute the chi-square statistic with SUMPRODUCT((observed − expected)^2 / expected) and then take SQRT(statistic / (n × MIN(rows − 1, columns − 1))). In R use rcompanion::cramerV, DescTools::CramerV or lsr::cramersV. In Python use scipy.stats.contingency.association(table, method="cramer").

Why does the calculator refuse a table with an empty row or column?

A row or column with no observations is not a category that occurs in the data, and it would make the expected counts zero. Measuring the table without it gives a different value from measuring the one you entered, so rather than choosing for you, the calculator asks you to remove the row or column or to enter its counts.

Can I use Cramér's V for ordinal variables?

You can, but V treats the categories as unordered and ignores their order, so it can understate a steady trend. For two ordinal variables Kendall's tau-b, Goodman and Kruskal's gamma or Somers' D use the order of the categories.

Embed This Calculator

Add this free calculator to your course page or LMS.

Adjust the height value to fit your page.