---
title: "method"
slug: "method-syntax"
updated: 2022-12-13T02:13:50Z
published: 2022-12-13T02:13:50Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://code.tag.bio/llms.txt
> Use this file to discover all available pages before exploring further.

# method

## method

**usage: required - datatype: string** Every Tag.script requires a *method* attribute. There are three analysis methods:

1. The "tag-comparison" method compares the size of the intersection for each categorical *analysis_variable* and the *focus* attribute to the size of the intersection with the *background* attribute. In addition, the "tag-comparison" method compares the distribution of each numeric *analysis_variable* between the *focus* attribute and the *background* attribute.
2. The "numeric-comparison" method compares the distribution of the *numeric_focus* attribute between each categorical *analysis_variable* and the *background* attribute.
3. The "summary" method performs a statistical summary of each numeric and categorical *analysis_variable* over the *background* attribute.

```
"method": "mmmm" //tag-comparison, numeric-comparison, or summary
```

## method options

### summary

**Question: What are the simple counting and summary statistics for each categorical and numeric variable, given the background?**

The intersection of each categorical variable object listed in `analysis_variables` will be intersected with the `background`. In addition, the distribution of each numeric variable object listed in `analysis_variables` will be summarized for only those entities defined by the `background`.

### tag-comparison

**Question: What variables have significantly different intersections and numeric distributions for the specified categorical variable?**

The `tag-comparison` `method` requires a `focus` attribute. The `focus` attribute must be a categorical variable object. The intersection of each categorical variable object listed in `analysis_variables` will be calculated with the `focus` and compared to that variable's intersection with the`background`. Additionally, the distribution of each numeric variable object listed in `analysis_variables` will be compared between the `focus` and the `background`.

By default, [Fisher's exact test](https://en.wikipedia.org/wiki/Fisher's_exact_test) is used for categorical variables, and [Mann-Whitney](https://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test) for numeric variables. The `numeric_tag_algorithm` of the `protocol` `script` can be changed if a [t-test](https://en.wikipedia.org/wiki/Student's_t-test) is needed.

![image.png](https://cdn.document360.io/2bd95121-d9ee-4ca9-a76a-2725b127d6bd/Images/Documentation/image.png)

### numeric-comparison

**Question: What variables have significantly different distributions for the specified numeric variable?**

The `numeric-comparison` `method` requires a `numeric_focus` attribute. The `numeric_focus` must be a numeric variable object. The Tag.cortex engine will create a distribution of the `numeric_focus` variable for the entities defined by the `background` and compare it to the distribution of the `numeric_focus` variable for each categorical variable object listed in `analysis_variables`

![image.png](https://cdn.document360.io/2bd95121-d9ee-4ca9-a76a-2725b127d6bd/Images/Documentation/image%281%29.png)

## survival-comparison

The `survival-comparison` `method` requires a time variable as the`numeric_focus` attribute and a censoring variable as the `focus` attribute.

### download

**Question: Can I download the results of a summary analysis as a CSV?**

The `download` `method` will calculate the intersection of each categorical variable object listed in `analysis_variables` with the `background`. The distribution of each numeric variable object listed in `analysis_variables` will be summarized for only those entities as defined by the `background` Upon executing this analysis, the user is prompted to download the results as a CSV.

### numeric-multivariate

Performs linear regression. The default `numeric_multivariate_algorithm` is ordinary least squares. This requires the assignment of `test` and `train` attributes.

### projection

Used in Uniform Manifold Approximation and Projection or [UMAP](https://arxiv.org/abs/1802.03426) algorithm for fast dimension reduction clustering, PCA or t-SNE. The `projection_algorithm` attribute can be either `umap`, `pca`, or `t-sne`. Note that all algorithms require their own parameters.

### external

To `external` protocol is used to execute an R or Python script and to return those results to the front end.

### batch

Coming soon

### batch-exploratory

Coming soon

### paired-batch

Coming soon
