# Compute Statistics

This module enables users to plot the relationship between any 2 variables (genes) or observations. The plot type is automatically chosen based on the selection. For each combination, appropriate statistical computations are performed. A [`Standard Compute`](/documentation/compute-runtimes/codeless-compute.md) runtime is required.

## Command Form

The command form captures the information required to run the compute statistics analysis.

* Subset (*optional*) - A [data slice](/documentation/analyses/data-slices.md)
* Variable 1 (*required*) - A gene or observation present in the dataset
* Variable 2 (*required*) - A gene or observation present in the dataset
* Color / Grouping (*optional*) - An observation used to group the values
* Drop cells/samples with zero counts - Applies only to genes. Removes all entries with zero counts to prevent skewing the plot.

<div align="left"><figure><img src="/files/GAiN8N6yLoD6Ru8eEf54" alt="" width="347"><figcaption></figcaption></figure></div>

## Combinations table

<table><thead><tr><th width="301">Combination</th><th width="178">Plot Type</th><th>Additional Computations</th></tr></thead><tbody><tr><td>Gene v. Gene</td><td>Scatter plot</td><td>Correlation, <a href="https://en.wikipedia.org/wiki/Ordinary_least_squares">Regression (OLS)</a></td></tr><tr><td>Gene v. Cont. Observation</td><td>Scatter plot</td><td>Correlation, <a href="https://en.wikipedia.org/wiki/Ordinary_least_squares">Regression (OLS)</a></td></tr><tr><td>Gene v. Categ. Observation</td><td>Box plot</td><td><a href="https://en.wikipedia.org/wiki/Analysis_of_variance">ANOVA</a>, <a href="https://en.wikipedia.org/wiki/Tukey%27s_range_test">Tukey's Test</a></td></tr><tr><td>Cont. Obs. vs Cont. Obs</td><td>Scatter plot</td><td>Correlation, <a href="https://en.wikipedia.org/wiki/Ordinary_least_squares">Regression (OLS)</a></td></tr><tr><td>Cont. Obs vs Categ. Obs</td><td>Box plot</td><td><a href="https://en.wikipedia.org/wiki/Analysis_of_variance">ANOVA</a>, <a href="https://en.wikipedia.org/wiki/Tukey%27s_range_test">Tukey's Test</a></td></tr><tr><td>Categ. Obs vs Categ. Obs</td><td>Matrix plot</td><td><a href="https://en.wikipedia.org/wiki/Chi-squared_test">Chi-squared Test</a></td></tr></tbody></table>

## Results

Results can be displayed in either a tile view or a grid view. Use the buttons next to the search bar to toggle the mode.

The quick search bar is visible only for tile view and it offers an easy way to get to any result. The name of the result is used for searching.

### Tile View <a href="#tile-view" id="tile-view"></a>

Each result in the tile view is a static plot generated based on the types of variables inputted.

<figure><img src="/files/HrPw3JSGRaoU02gCc6fE" alt=""><figcaption><p>Tile view</p></figcaption></figure>

### Grid View

Each row in the grid represents a result. To view a result, click on a row.

<figure><img src="/files/WuGMxpOn0c2P8UY63jlK" alt=""><figcaption><p>Grid view</p></figcaption></figure>

### Result Details View <a href="#result-details-view" id="result-details-view"></a>

The compute statistics result page contains 2 or 3 tabs, depending on the types of variables chosen.

#### Plot

Present for all results. Refer to the [combinations table](#combinations-table) to see what plot types get generated.

<div><figure><img src="/files/t1O9cLS4bv2eWCTwYyOQ" alt=""><figcaption><p>Scatter plot</p></figcaption></figure> <figure><img src="/files/ihqTIcbbZWAOldZUyISH" alt=""><figcaption><p>Box plot</p></figcaption></figure> <figure><img src="/files/F24qnYKMH4A8OuWFVMek" alt=""><figcaption><p>Matrix plot</p></figcaption></figure></div>

#### ANOVA data

Available only for continuous vs categorical results.

<figure><img src="/files/QjTO4RI6UrswEXeXjlmB" alt=""><figcaption><p>ANOVA data</p></figcaption></figure>

#### Tukey summary

Available only for continuous vs categorical results.

<figure><img src="/files/QyA824RxFHCAVZzTjFFW" alt=""><figcaption><p>Tukey summary</p></figcaption></figure>

#### Correlation data

Available only for continuous vs continuous results.

<figure><img src="/files/oKFYPQYL2HpKgubDqx6G" alt=""><figcaption><p>Correlation data</p></figcaption></figure>

#### OLS summary

Available only for continuous vs continuous results.

<figure><img src="/files/zfQ8bNdu9DEGB47Wx6fK" alt=""><figcaption><p>OLS summary</p></figcaption></figure>

#### Chi-square test

Available only for categorical vs categorical results.

<figure><img src="/files/5smWkrYkXkwqU50GSt1E" alt=""><figcaption><p>Chi-square test</p></figcaption></figure>

## Video demonstration

{% embed url="<https://www.loom.com/share/1379da414c7849d08d552843bd65a10d?sid=c6269615-881b-4f5b-9464-c2f90d380a64>" %}
Compute statistics
{% endembed %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.panomics.bio/documentation/analyses/analysis-workbench/compute-statistics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
