> For the complete documentation index, see [llms.txt](https://docs.owkin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.owkin.com/explore-and-analyse-data/data-analysis/cohort-clinical-description/multi-variable-summary-table.md). Agents can also search and read this documentation through its [MCP server](https://docs.owkin.com/~gitbook/mcp).

# Multi-variable summary table

Summarize the distributions of multiple characteristics within each group, reporting counts and percentages for each value.

Summarize the distributions of multiple characteristics within each group, reporting counts and percentages for each value.

## Multi-column distribution table

### Description

#### Analysis summary

Summarises the distribution of several categorical feature columns across patient groups: per group, the count and share of observations carrying each value of each feature.

#### Computation

For each feature column (every column in the table except the grouping columns and the patient identifier), the count of each unique value is computed per group — and per subgroup when a second grouping column is given. Numeric feature columns are binned into six equally-spaced bins first, either by the adapter's binning rules or automatically, so they enter the same counting. The result is one table with the features as row blocks, their values as rows and the groups as columns; each cell holds the count and the percentage of that group's observations carrying the value. The table is returned as formatted Markdown text rather than as a data frame. No statistical tests are computed.

#### When to use

Use for cohort-overview questions spanning several clinical or biological variables at once: the composition of patient groups by stage, gender, smoking status and similar. For a single variable or for numeric summaries with statistics, use the other analyses instead; for counts of patients per condition, use the population-overview mode of this module.

#### Caveats

Counts and shares describe the queried data only — no test or comparison is run between groups. Rows with a missing value are excluded from that feature's counts, so percentages are relative to the non-missing observations.

### Example questions

<details>

<summary><code>example questions</code></summary>

* Multiple clinical variables distribution summary across groups

</details>

### Input columns

<details>

<summary><code>input columns</code></summary>

| column      | type        | required | description                                                                                                                                                          |
| ----------- | ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| x\_group    | categorical | required | Grouping variable — one column per group in the output table.                                                                                                        |
| x\_subgroup | categorical | optional | Secondary grouping variable for two-level stratification (e.g. dataset\_name). Optional.                                                                             |
| index       | any         | optional | Granularity identifier for the rows of the table (e.g. patient\_id, sample\_id, cell\_id). Excluded from feature processing. Use index\_label to set its display na… |
| patient\_id | any         | required | Patient identifier. Excluded from feature processing if present.                                                                                                     |
|             | categorical | optional | Any additional columns to summarise — whatever the SQL SELECT'd besides x\_group, x\_subgroup, and patient\_id. Continuous columns should be pre-binned in SQL (e.…  |

</details>

### Visualizations

* `summary_table` How to read: A Markdown table: one row block per feature, one row per value, one column per group (× subgroup when used); each cell reads 'count (share %)' — the number of that group's observations carrying the value, and their share of the group. Colour-coded group legends name the columns. Comparing cells across a row shows how the value's prevalence differs between groups.

### Example analysis 1

#### Name — Clinical Summary by Cancer Type (TCGA)

#### Analysis parameters

<details>

<summary><code>analysis_name, analysis_params, viz_params</code></summary>

```json
{
  "analysis_name": "multi_variable_summary_analysis",
  "analysis_params": {},
  "viz_params": {
    "plot_name": "summary_table",
    "title": "Clinical Summary by Cancer Type (TCGA)",
    "x_group_label": "Cancer Type"
  }
}
```

</details>

#### Visualization — `summary_table`

#### Output table

#### Clinical Summary by Cancer Type (TCGA)

| Feature                | Modality                            | lung\_adenocarcinoma | malignant\_neoplasm\_of\_urinary\_bladder |
| ---------------------- | ----------------------------------- | :------------------: | :---------------------------------------: |
| **age\_bin**           | 50-64                               |      188 (36.4%)     |                128 (31.4%)                |
|                        | 65+                                 |      296 (57.3%)     |                258 (63.2%)                |
|                        | <50                                 |       33 (6.4%)      |                 22 (5.4%)                 |
| **clinical\_t\_stage** | t1                                  |      170 (33.1%)     |                 11 (2.7%)                 |
|                        | t2                                  |      278 (54.1%)     |                191 (46.8%)                |
|                        | t3                                  |       47 (9.1%)      |                161 (39.5%)                |
|                        | t4                                  |       19 (3.7%)      |                 45 (11.0%)                |
| **gender**             | female                              |      278 (53.8%)     |                107 (26.2%)                |
|                        | male                                |      239 (46.2%)     |                301 (73.8%)                |
| **smoking\_status**    | tobacco\_active\_or\_former\_smoker |       4 (0.8%)       |                 12 (3.0%)                 |
|                        | tobacco\_former\_smoker             |      135 (26.8%)     |                113 (28.6%)                |
|                        | tobacco\_non\_smoker                |      168 (33.4%)     |                 72 (18.2%)                |
|                        | tobacco\_smoker                     |      196 (39.0%)     |                198 (50.1%)                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.owkin.com/explore-and-analyse-data/data-analysis/cohort-clinical-description/multi-variable-summary-table.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
