Help:RiskParameter
Help:RiskParameter
The <riskparameter> tag sets fixed values for one or more variables used in a risk calculation defined by a RiskModel or RiskDisplay. It is used on main pages alongside <riskdisplay> and <dropdown> tags to "hard-code" values specific to the page’s context.
Syntax
The <riskparameter> tag uses attributes to specify variable names and their fixed values. Each attribute represents a variable-value pair (e.g., `miles_driven="14000"`).
Basic syntax:
<riskparameter miles_driven="14000" />
Multiple variables:
<riskparameter miles_driven="14000" exposure_factor="0.5" />
Usage
- Use the <riskparameter> tag on a main page alongside <riskdisplay> and <dropdown> tags to set fixed values for variables used in a risk calculation.
- Ensure each attribute name matches a variable in a RiskModel or RiskDisplay calculation.
- Specify the fixed values as attribute values, such as numbers relevant to the page’s context (e.g., `14000` for typical annual miles driven in the US).
The <riskparameter> tag fixes the specified variables’ values for calculations on the page, overriding any default or dynamic values.
Examples
Setting a Single Variable
Set the `miles_driven` variable to 14,000 for a driving risk page:
<riskparameter miles_driven="14000" />
This fixes `miles_driven` to 14,000 for any risk calculations on the page.
Setting Multiple Variables
Set `miles_driven` and `exposure_factor` variables:
<riskparameter miles_driven="14000" exposure_factor="0.5" />
This sets `miles_driven` to 14,000 and `exposure_factor` to 0.5 for use in calculations.
Combined with RiskDisplay and Dropdown
Use <riskparameter> with other tags on a driving risk page:
<riskparameter miles_driven="14000" exposure_factor="0.5" distraction_odds_ratio="1.2" /> <dropdown table="DrivingConditions" title="Select condition" label_column="Condition" /> <riskdisplay model="DrivingRisk" />
This sets `miles_driven`, `exposure_factor`, and `distraction_odds_ratio`, allows the user to select a condition via <dropdown>, and displays the result using the "DrivingRisk" <riskmodel>.
Notes
- Each attribute name must match a variable used in a RiskModel or RiskDisplay calculation.
- Use <riskparameter> to set context-specific values, like average miles driven or fixed probability factors.
- The tag is typically used on main pages, while <riskmodel> definitions are often on "/Data" subpages.
- Multiple variables can be set in a single <riskparameter> tag using additional attributes.
Troubleshooting
- **Calculation fails** – Ensure each attribute name matches a variable in the <riskmodel> or <riskdisplay> calculation.
- **No effect on calculation** – Verify that the <riskparameter> tag is on the same page as the <riskdisplay> or <dropdown> tags and that the attribute values are valid (e.g., numbers for numerical calculations).
- **Result not displayed** – Check that the <riskdisplay> tag references a valid <riskmodel> and includes the `{result}` placeholder if overriding text. See RiskModel documentation for details.
For related features, see RiskModel documentation, RiskDisplay documentation, or DropDown documentation.