Goodman Kruskal Gamma Calculator

Evaluate ranked dependence with flexible inputs and summaries. Compare pair structure, strength, and directional consistency. See meaningful ordinal patterns before making analytical judgments today.

Calculator Inputs

Keep both variables in ascending order. Gamma requires ordinal categories and ignores ties when forming the core coefficient.

Accepted separators

Use commas, spaces, semicolons, or tabs. Each row must have the same number of cells. Blank lines are ignored.

When matrix mode helps

Use this mode for survey scales, performance levels, or ranked categories where both dimensions are naturally ordered.

Rows and columns must stay ordinal. Do not swap category order after counting the cells.
Reset

Example Data Table

The sample below compares two ordered three-level ratings. Higher row and column numbers indicate stronger or better ordered outcomes.

Rating group Low outcome Medium outcome High outcome Row total
Low predictor 12 5 1 18
Medium predictor 6 14 4 24
High predictor 2 7 16 25
Column total 20 26 21 67
Example concordant pairs
954
Example discordant pairs
133
Example gamma
0.755290

Formula Used

Core coefficient

Gamma = (C − D) / (C + D), where C is the number of concordant pairs and D is the number of discordant pairs.

Concordant and discordant pairs from a matrix

For each cell n(i,j), count all cells strictly down-right for concordant contributions and all cells strictly down-left for discordant contributions.

C = Σ n(i,j) × Σ n(k,l) for k > i and l > j. D = Σ n(i,j) × Σ n(k,l) for k > i and l < j.

Approximate inference

For a quick analytical interval, the page uses an approximate standard error:

SE ≈ sqrt((1 − Gamma²) / (C + D)), then Z = Gamma / SE, followed by a normal-approximation confidence interval and p value.

Interpretation note

Gamma ranges from -1 to +1. Positive values show aligned ordering. Negative values show reverse ordering. Zero suggests balance between concordant and discordant evidence. Ties are ignored, so very tie-heavy data may suit tau-b or Somers' D better.

How to Use This Calculator

1. Choose the input mode that matches your data source: direct pair counts, a 2 by 2 ordered table, or a larger ordered matrix.
2. Enter categories in true ordinal order. Reversing row or column order flips the meaning of concordant and discordant pairs.
3. Select your desired confidence level. The calculator will estimate a standard error, interval, and two-tailed p value.
4. Press Calculate Gamma. The result appears below the header and above the form, together with summary metrics and a Plotly chart.
5. Use the CSV button to save a numeric summary, or use the PDF button to export the visible result block as a shareable report.

FAQs

1) What does Goodman Kruskal gamma measure?

It measures ordinal association between two ranked variables. The coefficient compares concordant versus discordant pairs and ignores tied pairs in the main ratio.

2) When should I use gamma instead of Pearson correlation?

Use gamma when both variables are ordinal rather than continuous. It is especially useful for survey scales, rank categories, ordered clinical scores, and preference levels.

3) Why can gamma become large when many ties exist?

Gamma excludes tied pairs from its denominator. If ties are common, the remaining untied pairs can make the association look stronger than tie-sensitive measures.

4) What counts as a concordant pair?

A pair is concordant when the observation ranked higher on one variable also ranks higher on the other variable. Their ordering agrees in direction.

5) What counts as a discordant pair?

A pair is discordant when the observation ranked higher on one variable ranks lower on the other variable. Their ordering moves in opposite directions.

6) Can I use this with a 2 by 2 table?

Yes. The 2 by 2 mode calculates concordant and discordant pairs directly from the ordered table, then applies the same gamma formula and interval logic.

7) Is the p value exact?

No. This page uses a normal-approximation method for quick analytical reporting. For small samples or complex tie structures, specialist statistical software may provide better inference.

8) What does a negative gamma mean?

A negative gamma means the ordering tends to reverse across variables. Higher ranks in one variable usually align with lower ranks in the other.

Related Calculators

spearman rank correlation calculatoriqr calculatorkernel density estimatorfisher exact test calculatorcramer v calculatortheil sen estimatorkruskal wallis test calculatoranderson darling test calculatordistribution similarity testpaired sign test

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.