-
Notifications
You must be signed in to change notification settings - Fork 0
Scenarios
Running a scenario on a population or an individual allows you to evaluate how changing a risk factor or a combination of risk factors changes the outcome of a model. Using the scenario API we can answer questions like:
- How does the life expectancy of a population change if I decrease smoking by 10%?
- How much does an individual's mortality risk change by if they improve their diet?
A key ingredient required to run a scenario is what we call a scenario object. A scenario object is a JSON object that tells the engine how to run a scenario. Although there is a lot going on underneath the hood when running a scenario, the 3 main steps are outlined below:
- Does the individual meet the inclusion criteria for the scenario? This is decided by the
targetPop
field. - Update the scenario variable using the method outlined in the
method
field. - Check the updated variable value using the
postScenarioRange
field.
The method
field decides how the variable(s) involved in a certain scenario are manipulated. The methods we currently offer are described below:
- Simple Methods: These are methods that involve simple changes to a variable. Such as changing it to a new value, updating it by a percentage or an absolute value.
- Categorical Methods: These are methods that involve changes to the prevalence of a risk factor and can be used only with categorical variables. For eg. Changing the prevalence of smoking in a population.
- Component Methods: These are methods that involve changes to a variable based on the value of another variable. For eg. Changing the amount of vegetables a person eats based on their total fruit and vegetable consumption.
Example: How would the life expectancy of a population change if they all started following the "Canadian Physical Activity Guidelines"?
The JSON object below implements the question described above. Don't worry if it does not make sense, we will be explaining the various fields that go into the object in other sections.
{
"subject": "Activity",
"algorithms": ["MPoRTv2-PUMF"],
"description": "Physical activity - MET-hours per day",
"scenarios": [
{
"name": "Canadian physical activity guidelines",
"method": "Attribution",
"reference": "Canadian 24-Hour Movement Guidelines: An Integration of Physical Activity, Sedentary Behaviour, and Sleep. Canadian Society for Exercise Physiology website: https://www.csep.ca/guidelines. Accessed November 22, 2019",
"description": "the Canadian Physical Activity Guidelines for Adults (18+ years) of 150 minutes of moderate- to vigorous-intensity activity per week, translated into daily MET-hours.",
"descriptionDetails": "Respondents below the reference value are recoded to reference value (2.1 MET-hours/day), all other respondents retain their reported value. Respondents with missing values are assumed to have the population average prior to changing their exposure.",
"male": {
"variables": [
{
"variableName": "PACDEE",
"method": "attribution-scenario",
"scenarioValue": 2.1,
"targetPop": [0, 2.1],
"postScenarioRange": [2.1, null]
}
]
},
"female": {
"variables": [
{
"variableName": "PACDEE",
"method": "attribution-scenario",
"scenarioValue": 2.1,
"targetPop": [0, 2.1],
"postScenarioRange": [2.1, null]
}
]
}
}
]
}
Go over this page that describes the general structure of a scenario object as well as the fields common from one object to another.