Relative Risk
A relative risk (RR) quantifies how much a simulant’s exposure to a risk factor increases (or decreases) the rate of some outcome compared to a reference exposure level. A relative risk of 1 means no additional risk; values greater than 1 indicate elevated risk; values between 0 and 1 indicate protective effects.
The CausalFactorEffect
base class (and its subclass
RiskEffect) registers a
{risk_name}_on_{target_name}.relative_risk
pipeline whose source computes RR values for each
simulant. This pipeline is then registered as a modifier on the target rate
pipeline (e.g., cause_name.incidence_rate), so the target rate is
multiplied by each simulant’s relative risk every time the rate is evaluated.
Relative risk data is loaded from the simulation artifact by default, but can
be overridden with a scalar value or a scipy.stats distribution name in the
configuration (see the
CausalFactorEffect class
documentation for details).
How relative risk is computed depends on whether the risk factor’s exposure is categorical or continuous.
Categorical Exposure
For categorical risks (dichotomous or polytomous), relative risk data is loaded from the simulation artifact as a table mapping each exposure category to an RR value. When determining a simulant’s relative risk, the component looks up the simulant’s current exposure category and returns the corresponding RR from the table.
For dichotomous risks, the “unexposed” category always has an RR of 1 and the “exposed” category carries the loaded RR value.
Log-Linear Model (Continuous Exposure)
For continuous risk factors, the default
RiskEffect component uses a
log-linear model. In this model, the logarithm of
the relative risk is proportional to the difference between the simulant’s
exposure and the TMREL:
where:
\(x\) is the simulant’s current exposure value,
\(\text{TMREL}\) is the theoretical minimum-risk exposure level, computed as the midpoint of the TMRED,
\(RR_{\text{per-unit}}\) is the relative risk per unit of exposure loaded from the artifact, and
\(\text{scale}\) is a scalar loaded from the artifact (
{risk}.relative_risk_scalar) that defines the exposure increment to which the per-unit RR corresponds.
The result is clipped to a minimum of 1, so the relative risk never falls below the baseline.
Non-Log-Linear Model (Piecewise Interpolation)
When the dose–response relationship between exposure and relative risk is not
well described by a log-linear curve, the
NonLogLinearRiskEffect component
can be used instead. This component:
Loads TMRED data from the artifact and computes the TMREL as a uniform random draw between the TMRED’s minimum and maximum.
Interpolates the RR at the TMREL from the configured RR data points and divides all RR values by this quantity, so that the RR at the TMREL equals 1. The result is clipped to a minimum of 1.
Constructs a lookup table of piecewise-linear intervals from the normalized RR data. Each interval has a left and right exposure boundary and corresponding left and right RR values.
When determining a simulant’s relative risk, identifies which interval contains the simulant’s exposure and linearly interpolates:
where \(x\) is the simulant’s exposure and the left/right values are the boundaries of the enclosing bin.
To avoid recomputing the exposure pipeline every time the relative risk is
queried, the NonLogLinearRiskEffect caches each simulant’s exposure value
in a column on the state table and reads from that
cached column when interpolating.
Unmodeled Cause Mortality
Risk effects can target unmodeled cause mortality rates. In this case the risk effect component modifies the cause-deleted mortality pipeline in the same way it would modify any other target rate — by multiplying the rate by each simulant’s relative risk and applying a calibration constant.