# Genotypic Association Test

The Genotypic Association Operation will be performed along with a report and 2 charts. Only Markers and Samples that have passed the basic Matrix QA and the Hardy-Weinberg test, filtered by specified missingness thresholds, HW equilibrium conformity as well as non-mismatching markers status will be considered in this test.

You may find further details on how to perform basic statistical analysis in a population-based genetic association case-control study in this Nature Protocls article.

Using the recount of Genotypes done at the Genotype Frequency count, a 3×2 contingency table is considered for each marker as in the following example:

Observed AA Aa aa Row Total
Case 110 85 15 210
Control 90 72 48 210
Column Total 200 157 63 420

Expected genotype values must be calculated for every cell, as per the following formulas:
``` expected case AA = (observed case Row Total × observed AA Column Total) / total genotypes expected case Aa = (observed case Row Total × observed Aa Column Total) / total genotypes expected case aa = (observed case Row Total × observed aa Column Total) / total genotypes expected control AA = (observed control Row Total × observed AA Column Total) / total genotypes expected control Aa = (observed control Row Total × observed Aa Column Total) / total genotypes expected control aa = (observed control Row Total × observed aa Column Total) / total genotypes ```

Resulting in following expected values table:

Expected AA Aa aa
Case 110 85 15
Control 45 36 24

From these values GWASpi calculates the X² value as follows:
``` X² = ((obsCaseAA-expCaseAA)² / expCaseAA) +     ((obsCaseAa-expCaseAa)² / expCaseAa) +     ((obsCaseAa-expCaseAa)² / expCaseaa) +     ((obsControlAA-expControlAA)² / expControlAA) +     ((obsControlAa-expControlAa)² / expControlAa) +     ((obsControlaa-expControlaa)² / expControlaa); ```
From this X² value, a p-value can be calculated for a X² distribution with 2 degrees of freedom.

Genotypic Association Odds Ratios
The Genotypic Odds Ratios (OR) can be calculated for ‘AA’ vs ‘aa’ and ‘Aa’ vs ‘aa’ as follows:

``` ORAA-aa = (caseAa × ctrlaa) / (caseaa × ctrlAa) ORAa-aa = (caseAA × ctrlaa) / (caseaa × ctrlAA) ```
``` Then: If OR is < 1: OR = 1/OR ```

See Association Test Reports section for details on table displays and charts.