Description Usage Arguments Value
View source: R/calibrate_risk.R
calibrate_risk() is a function that calculates the actual event rate of acute events by predicted risk quantile and initial period treatment status.
1 | calibrate_risk(DT, keep_vars, cont_risk_var, n_quant, event_var, treated_var)
|
DT |
data.table with keep_vars, cont_risk_var, event_var, and treated_var |
keep_vars |
character vector, names of subsetting variables (e.g. "keep_jan") |
cont_risk_var |
character, name of contrinuous risk prediction variable (e.g. "comp_card_untreated_statin") |
n_quant |
interger, number of quantiles to break cont_risk_var in to |
event_var |
character, name of the realized event variable (e.g. "ami") |
treated_var |
character, name of the binary treatment indicator variable |
data.table with following columns:
treated |
indicator for initial period treatment |
risk |
quantile of predicted risk |
mean |
realized event rate |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.