Compute P for pre-exposure risk gain

computePreExposureGainP(sccsData, studyPopulation, exposureEraId = NULL)

Arguments

sccsData

An object of type SccsData as created using the getDbSccsData function.

studyPopulation

An object created using the createStudyPopulation() function.

exposureEraId

The exposure to create the era data for. If not specified it is assumed to be the one exposure for which the data was loaded from the database.

Value

A one-sided p-value for whether the rate before exposure is higher than after, against the null of no change.

Details

Compares the rate of the outcome in the 30 days prior to exposure to the rate of the outcome in the 30 days following exposure. If the rate before exposure is higher, this indicates there might reverse causality, that the outcome, or some precursor of the outcome, increases the probability of having the exposure.

The resulting p-value is computed using a Poisson model conditioned on the person.