# Run Signal Calculations

You can run _Signal Calculations_ to obtain _Case_ counts and scores that help you determine whether a specific adverse event occurs disproportionately for a specific product. On _Signal Calculation Runs_, you can specify the type of calculation you will run on all data for a single or all associated data sources. 

Based on your Admin's configured _Signal Calculations_, you can run calculations to detect _Product-Event Combinations_ (PECs) on all or a subset of data for specified reporting periods. You can also run ad hoc calculations outside of a product's reporting period. Optionally, for a more specific output, you can <a href="/en/gr/753141/#how-to-add-filters">add safety view filters</a> to the calculation run record. After running a _Signal Calculation_, you can preview the data in the _Preview_ section or by saving the results in a [CSV file][2]. 

For a broader look at the signal detection process, see the <a href="/en/gr/935430/">Signal Detection Overview</a>.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: If <a href="/en/gr/826975/">scheduled signal detection</a> is in the process of running <em>Signal Calculations</em>, you cannot manually run the <em>Signal Calculations</em>.</p>
    </div>
  </div>
</div>



### Subgroups {#subgroups}

Subgroups allow you to analyze Safety data for potential signals in specific populations and identify whether a safety concern is isolated to this specific population. Running calculations with subgroups segments _Product Families_ to provide a nuanced look. For example, if identifying potential signals within a _Product Family_ based on _Sex_, Vault returns results for the _Female_ and _Male_ populations. 

For _Signal Calculations_ <a href="/en/gr/753144/#signal-calculation-fields">configured with subgroups</a>, Vault returns data segmented into the following categories based on your Admin's configuration: 
* _Age Group_
* _Indication_
* _Receipt Year_
* _Region_
* _Route of Admin_
* _Sex_

## Prerequisites {#prerequisites}

Consider the following prerequisites:
* To run _Signal Calculations_, your Admin must configure <a href="/en/gr/753144/">calculation objects</a>.
* For the FAERS data source, your Admin must configure <a href="/en/gr/935439/">calculations and _Statistical Data_ creation</a>.
* For the VAERS data source, your Admin must configure <a href="/en/gr/1006100/">calculations and _Statistical Data_ Creation</a>.
* To store _Signal Calculations_ in CSV format, your Admin must configure <a href="/en/gr/935443/">calculations for _MedDRA Queries_</a>.
* To store _Signal Calculations_ of different data sources in a single _Statistical Data_ record, your Admin must enable <a href="/en/gr/1005912/">multi-source signal data consolidation</a>.

## Run & Preview Signal Calculations {#run-preview-signal-calculations}

To run calculations and preview calculation results:
1. Navigate to the **Run Calculations** tab.
2. Select a **Signal Calculation Run** record. \
    The _Calculations Setting_ and _Calculation_ fields provide more detail about the calculation, including any view parameters. If the _Calculation_ field is blank, running the _Signal Calculation Run_ executes all _Signal Calculations_ in the _Active_ state associated with the _Signal Calculations Setting_.
3. Expand the _Filters_ section and each filter group to provide filter values as needed and to apply additional filters. \
    If the _Signal Calculation Run_ is set to execute all calculations associated with the _Signal Calculations Setting_ (the _Calculation_ field is blank), Vault does not display available filters and populates them based on the selected _Reporting Period_.
4. From the **All Actions** menu, select **Calculate**. Calculation results expire after seven days and you must select this action again before previewing, storing, or [downloading][2] results.
5. Expand the _Preview_ section and then select **Preview**. \
    If the run is set to execute all calculations associated with the _Signal Calculations Setting_, Vault inactivates the _Preview_ button.

**Results**

Vault displays a preview of the calculation results to a maximum of 100 _Cases_. If you leave the page, the _Preview_ section clears. To store the results of a _Signal Calculation_, <a href="/en/gr/935435/">create _Statistical Data_ records</a>.

If the action fails due to a SQL error, Vault creates an error log in **Business Admin > Objects > Workbench Logs**. By default, Vault sorts these logs by the day and time the error was encountered, starting with the most recent. In the _Workbench Log Data_ field, select the attachment to download the error log to review and resolve the issues.

{: #advanced-calculation}

If an advanced <a href="/en/gr/752951/">calculation</a> fails to generate a score for a PEC, Vault completes the action and includes descriptive advanced calculation error messaging for:
* Ad-hoc calculation runs in the _Preview_ section 
* Ad-hoc calculation runs in the [downloaded CSV][2] file
* The <a href="/en/gr/935435/#advanced-calculation-errors">_Advanced Calculation Errors_</a> field on _Statistical Data_ records created from scheduled or ad-hoc calculation runs

Calculation failures can occur in the following scenarios:
* The Empirical Bayes Geometric Mean (EBGM) calculation cannot converge (settle on a stable and reliable score). 
* The EBGM calculation does not have enough or valid data. For example, when there are no results for the product of interest or the calculation includes division by zero.
* The Information Component (IC) results in a negative or positive infinity.

## Download Signal Calculation Results as CSV {#download}

To download _Signal Calculation_ results to a CSV file:
1. Navigate to the **Run Calculations** tab.
2. Select a _Signal Calculation Run_ record.
3. From the **All Actions** menu, select **Download all as CSV**.

**Results**

If a _Signal Calculation_ was specified on the _Signal Calculation Run_, Vault creates a single CSV file. In the scenario where the _Calculation_ field on the _Signal Calculation Run_ was left blank and the run executed all active calculations associated with the calculations setting, Vault creates a ZIP file with CSVs using the following logic:
* If the _Results Output_ on the <a href="/en/gr/753144/#create-signal-calculations-settings">_Signal Calculations Setting_</a> is _Multiple Records_:
    * A CSV file for each _Signal Calculation_ for each data source with an _Output Type_ of _CSV Attachment_. For calculations of an external data source, Vault names the file accordingly, for example, `faers_calculation_result_SCALC-00001`. If multiple _Signal Calculations_ return data for the same _Product Family_-MedDRA query or _Aggregate Reporting Group_-MedDRA query combination, Vault merges this data into one CSV file.
    * A CSV file containing all _Signal Calculations_ with an _Output Type_ of _Statistical Data Record_ or blank. For calculations of different sources, Vault creates separate CSV files for each.
* If the _Results Output_ on the _Signal Calculations Setting_ is _Single Record_:
    * A CSV file for each _Signal Calculation_ with an _Output Type_ of _CSV Attachment_. Vault includes all calculation scores for a PEC in a single CSV file, regardless of the data source. For example, if calculations of the Safety and FAERS data source detect the same PEC, Vault includes these calculations in the same row in the CSV. If multiple _Signal Calculations_ return data for the same _Product Family_-MedDRA query or _Aggregate Reporting Group_-MedDRA query combination, Vault merges this data into one CSV file. 
    * A CSV file containing all _Signal Calculations_ with an _Output Type_ of _Statistical Data Record_ or blank, regardless of the data source

[1]: #run-preview-signal-calculations
[2]: #download