The SCCS can detect an increase in risk after exposure initiation, but if that increase in risk was already present (and even higher) right before the exposure this means that likely the exposure did not cause the increased risk. For example, if the exposure is indicated for a disease, and the disease causes the increased risk, we may see this pattern. We therefore need a diagnostic that evaluates whether the risk of the outcome is greater just before exposure compared to just after exposure initiation.
Ideally, this diagnostic would reverse if a decrease in risk was observed during exposure instead of an increase. Perhaps this behavior can be manually switched by the user.
Below is messy code from a private study package that computes a p-value for H1: risk before > risk after against H0: risk before =< risk after.
The SCCS can detect an increase in risk after exposure initiation, but if that increase in risk was already present (and even higher) right before the exposure this means that likely the exposure did not cause the increased risk. For example, if the exposure is indicated for a disease, and the disease causes the increased risk, we may see this pattern. We therefore need a diagnostic that evaluates whether the risk of the outcome is greater just before exposure compared to just after exposure initiation.
Ideally, this diagnostic would reverse if a decrease in risk was observed during exposure instead of an increase. Perhaps this behavior can be manually switched by the user.
Below is messy code from a private study package that computes a p-value for H1: risk before > risk after against H0: risk before =< risk after.