calibrate_risk: Calibrate Acute Event Prediction

Description Usage Arguments Value

View source: R/calibrate_risk.R

Description

calibrate_risk() is a function that calculates the actual event rate of acute events by predicted risk quantile and initial period treatment status.

Usage

1
calibrate_risk(DT, keep_vars, cont_risk_var, n_quant, event_var, treated_var)

Arguments

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

Value

data.table with following columns:

treated

indicator for initial period treatment

risk

quantile of predicted risk

mean

realized event rate


evanjflack/polypharmacy documentation built on Oct. 12, 2020, 10:45 a.m.