
Summary of Exposure and Response Timing Order
Source:R/population_analysis.R
summary_exp_resp_order.RdSummarizes the temporal relationship between exposure and response events for individuals who have both an exposure and a response diagnosis.
Value
A tibble with columns:
exp_respA factor indicating the exposure-response temporal relationship.
nCount of cases in each category.
percentagePercentage of total cases for each category.
Details
Categorizes the relationship as:
"Exposure < Response"if exposure occurred before the response,"Exposure == Response"if they occurred on the same date,"Exposure > Response"if exposure occurred after the response.
This function is intended for use in shiny applications and supports progress indication. If used in a shiny session, progress is displayed with `withProgress()`.
Examples
if (FALSE) { # \dontrun{
df <- data.frame(
exposure = sample(0:1, 100, replace = TRUE),
response = sample(0:1, 100, replace = TRUE),
DATE = sample(seq(as.Date("2020-01-01"), as.Date("2020-12-31"), by = "day"), 100, replace = TRUE),
resp.DATE = sample(seq(as.Date("2020-01-01"), as.Date("2020-12-31"), by = "day"), 100, replace = TRUE)
)
summary_exp_resp_order(df)
} # }