> For the complete documentation index, see [llms.txt](https://docs.dbnl.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dbnl.com/v0.21.x/using-distributional/testing/testing-strategies/test-that-columns-are-similarly-distributed.md).

# Test That Columns Are Similarly Distributed

One general approach to test if two columns are similarly distributed is using a nonparametric statistic. DBNL offers two such statistics: `scaled_ks_stat` for testing ordinal distributions and `scaled_chi2_stat` for testing nominal distributions.&#x20;

<details>

<summary>Example Test Spec</summary>

```json
{
    "name": "discrepancy_of_text_coherence_score",
    "description": "Test the nonparametric discrepancy of the coherence score distributions",
    "statistic_name": "scaled_ks_stat",
    "statistic_params": {},
    "assertion": {
        "name": "less_than_or_equal_to",
        "params": {
            "other": 0.25,
        },
    },
    "statistic_inputs": [
        {
            "select_query_template": {
                "select": "{EXPERIMENT}.coherence_score"
            }
        },
        {
            "select_query_template": {
                "select": "{BASELINE}.coherence_score"
            }
        },
    ],
}
```

</details>

<figure><img src="/files/g6I0Z7cvzi7qh6W7qjud" alt=""><figcaption><p>Example test on discrepancy of distribution of coherence_score</p></figcaption></figure>
