Help:RiskModel
Appearance
Help:RiskModel
The `riskmodel: missing name attribute
</nowiki>
Usage
1. Use the `riskmodel: missing name attribute
</nowiki>
This creates a model called "SimpleRisk" that multiplies `base_probability` and `distraction_odds_ratio` from a DataTable2 table.
Risk Model with Complex Calculation
Define a model with a more complex expression:
<riskmodel name="RiskScore" calculation="base_probability * severity_weight + mitigation_factor / 2">Calculates a weighted risk score</riskmodel>
This model, "RiskScore", computes `base_probability * severity_weight + mitigation_factor / 2`, using DataTable2 column names.
Notes
- The `name` attribute must be unique on the page to avoid conflicts.
- Variable names in the `calculation` must match column names in a DataTable2 table (e.g., `base_probability`, `severity_weight`). Mismatched names will cause errors when used.
- The `calculation` must be a valid mathematical expression. Invalid expressions will cause an error when used (e.g., in `<riskdisplay>`).
- The description inside the tag is optional but helps document the model’s purpose.
- Risk models can be defined on the current page or a "Data/" subpage and referenced by name in other tags.
Troubleshooting
- **Error: "riskmodel: missing name attribute"** – Include the `name` attribute in the tag.
- **Error: "riskmodel: missing calculation attribute"** – Include the `calculation` attribute.
- **Error: "riskmodel [expression]: [error message]"** – Check the `calculation` for syntax errors (e.g., unbalanced parentheses or invalid operators).
- **Model not found in `<riskdisplay>`** – Ensure the `name` matches exactly and the model is defined on the current page or a "Data/" subpage.
- **Calculation fails** – Verify that all variable names in the `calculation` match column names in the associated DataTable2 table.
For related features, see RiskDisplay documentation or DataTable2 documentation.