# Statistics

### Create Statistics

Statistics can be created for files, compensated files, and gates. To create a statistic, select the Statistic button from the side panel. There are several different statistics that can be added. If statistics are added to compensated files, the stat is calculated after compensation is applied.

#### Mean

Calculated by adding the values of all events for a parameter and diving by the total number of events.

#### Geometric Mean

Calculated by taking the common logarithm of each event for a parameter, dividing the sum by the total number of events and then raising 10^(result). Problems can occur if any event value is zero because Log(0) is undefined. A lot of datasets contain values of zero for events and therefore adjustments need to be made to the geometric mean formula to produce a meaningful result. There are multiple ways to get around this problem. We chose to do one of the easier methods - we add 1 to all values before the calculation and then subtract one from the final result.

#### Median

Equivalent to taking 50th percentile.

#### Std Dev

Standard Deviation - Calculated by first finding the mean for all the events for a parameter. Then for each event, we find the square of its distance to the mean and sum them. Then we divide by the the total number of events and take the square root.

#### CV

Coefficient of Variation - the ratio between the standard deviation and mean.

#### Correlation

Pearson Correlation Coefficient for two parameters. Calculated with the following:
r = Σ(xᵢ - x̄)(yᵢ - ȳ) / sqrt(Σ(xᵢ - x̄)² * Σ(yᵢ - ȳ)²)

where:

• xᵢ = values of first parameter
• x̄ = mean value of first parameter
• yᵢ = values of second parameter
• ȳ = mean value of second parameter

#### Count

The number of events that are contained within the population.

#### Min

The minimum value with in the population.

#### Max

The maximum value with in the population.

#### Percent

Calculated by taking the number of events in a population divided by the number of events in the file.

#### Parent Percent

Calculated by taking the number of events in a population divided by the number of events in its parent. If this stat is applied to a population without a parent (a file for instance), the percent will be 100%.

#### Percentile

The value below which a certain percentage of events (cells) in a dataset would be found.

#### Keyword

Every FCS file has a bunch of included keywords. These are key:value pairs that give information about the name of the file, the parameters, the cytometer, and a bunch more information about the data. Using the Keyword statistic you can show the value of a particular keyword.

#### Label

Allows you to attach a label with a custom value of your choosing to a population.

### Delete Statistic

Statistics can be deleted by right clicking them in the population tree and selecting "Delete". You can also ouble click on a statistic to bring up its details menu. Clicking delete in the menu will remove the stat.

### Copy Statistic

Statistics can be dragged and dropped onto other files, compensated files, or gates. To apply the entire gating tree and statistics from one file to all files in a project, select the file and press "Ctrl+A"

### Renaming Statistics

When you create a new stat, you have the option to input a custom display name if you so choose. You can also rename the stat at any time by opening its details menu and changing the display name. Renaming a statistic may be useful if the fully qualified name of the stat is very long because of a very nested gating tree, which can be difficult to work with when exported as a CSV file (See next section).

### Export Statistics

Statistics can be exported to a CSV file which can be opened in any spreadsheet-type application (Excel) for further analysis. To export stats, click "File" then "Save CSV File". When exported, all statistics from all open files in the current project will be tabulated.

Statistics will be show in the CSV file using a fully qualified path (i.e. [File]/[Gate]/[Gate]/[Stat]). If you have a very nested gating hierarchy this can be difficult to work with. If you have assigned a custom name to the statistic, both the custom name and the full name will be exported and can make further analysis a little easier.