Create a Statistical Model Template
Statistical Model Templates define how Stats Model data are processed. Users can create custom templates to run specific statistical calculations, based on the data anomalies that need to be surfaced. This article describes how to add a new Statistical Model Template to your Metric Insights instance.
NOTE: Writing the code for a Statistical Model Template is a technically advanced process. Please contact firstname.lastname@example.org for assistance with writing the correct code for a new template.
1. Create a New Stats Model Template
Access Admin > System > Stats Model Templates
The list page containing all Stats Model Templates available in the system opens.
- Below the grid, click [+ New Stats Dataset Template]
- Enter a Name for the Stats Template
2. Enter Dataset Viewer Code
Access the Dataset Viewer Code tab
- Enter the HTML for the Stats Model Editor
- Once the Statistical Model Template is saved and selected in the Stats Model Editor, the menu is displayed based on this code
4. Enter Statement Generation Code
4.1. Enter Code for MySQL
Access the Statement Generation Code tab
Enter the code that will generate a MySQL query based on the data collected by the script.
5. Use the Stats Model Template
Access the Dataset Viewer of a Dataset, on which you want to build a Stats Model
- Select Actions > Build Stats Model
- Click on the Template field
- Select the created Stats Model Template
For more details on creating a Stats Model, see Create a Statistical Model (Datasets).