CalcWorldHub
Free online calculator · no signup

Two locus linkage disequilibrium calculator

Quantify two-locus association from four phased haplotype frequencies, including normalized D-prime and r-squared.

4,000 tools
Two locus linkage disequilibrium calculator — Haplotype frequencies AB Ab aB ab and calculation method
Two locus linkage disequilibrium calculator: inputs and calculation method.

How to use this calculator

Quantify two-locus association from four phased haplotype frequencies, including normalized D-prime and r-squared.

  1. Enter Haplotype frequencies AB Ab aB ab. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Two locus linkage disequilibrium explained

Quantify two-locus association from four phased haplotype frequencies, including normalized D-prime and r-squared.

Linkage disequilibrium D0.15
Linkage disequilibrium D: 0.15 in the worked scenario.

How the calculation works

D=fAB−pApB; r²=D²/[pA(1−pA)pB(1−pB)]

Obtain the two allele marginals from phased AB, Ab, aB, and ab frequencies. Subtract the independent-product expectation from AB to form D. Divide by its sign-specific maximum for signed D-prime and by allele variance products for r-squared.

Set up the calculation

f — Haplotype frequencies AB Ab aB ab
Four phased haplotype frequencies in the fixed order AB, Ab, aB, ab. They must be nonnegative and sum to one; allele marginals are derived from this vector.

Limits of this model

Haplotypes must be phased or otherwise justified; unphased genotype counts cannot be entered directly. Monomorphic-locus normalization is undefined.

Check this example

Haplotype frequencies AB Ab aB ab = 0.4, 0.1, 0.1, 0.4.

  • Linkage disequilibrium D: 0.15
  • Signed D-prime: 0.6
  • Squared allelic correlation r²: 0.36

Both allele marginals are 0.5. Independent AB frequency would be 0.25, so observed 0.4 gives D=0.15, D-prime=0.6, and r²=0.36.

Interpreting the result

Here pA=pB=0.5, so linkage equilibrium would predict AB frequency 0.25. The observed 0.40 gives D=0.15, signed D′=0.60 and r²=0.36; these describe association, not causation.

Frequently asked questions

Are haplotype order and phase important?

Yes, enter AB, Ab, aB, ab in that order.

Can D be negative?

Yes, it indicates repulsion relative to the chosen allele labels.

Does high r² establish causality?

No.

How do I use the Two locus linkage disequilibrium calculator?

Enter Haplotype frequencies AB Ab aB ab. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Two locus linkage disequilibrium?

Haplotype frequencies AB Ab aB ab = 0.4, 0.1, 0.1, 0.4. Linkage disequilibrium D: 0.15 Signed D-prime: 0.6 Squared allelic correlation r²: 0.36 Both allele marginals are 0.5. Independent AB frequency would be 0.25, so observed 0.4 gives D=0.15, D-prime=0.6, and r²=0.36.