Description Usage Arguments Value
Create policy object
1 2 3 4 5  policy(formula, data, outcome, train = 0.5, risk = "resp_trt",
model = names(models()), down_sample = 1, fit1 = NULL, pred1 = NULL,
fit_ptreat = NULL, pred_ptreat = NULL, ptreat = NULL, resp_ctl = NULL,
resp_trt = NULL, calibrate = FALSE, save_models = FALSE,
recast_df = FALSE, seed = round(stats::runif(1) * 10000), ...)

formula 
a formula in the form of 
data 
data frame to use; must include all the columns specified in

outcome 
name of outcome column in data 
train 
either (1) a value between 0 and 1 representing the proportion
of data to use in training, (2) the name of a column of characters "train"
and "test" within 
risk 
One of 
model 
character of modelling method to use for risk models; run

down_sample 
(Optional) proportion (between 0 and 1) or number (greater than 1) of rows to sample, if down sampling the data; default is 1 (i.e., use all data) 
fit1 
a function of the form f(formula, data, ...) used for fitting the
firststage model; overides 
pred1 
a function of the form f(model, data, formula) used for
generating predictions from the firststage model; the formula argument can
be ignored within the function body, but the function should still accept
it; some prediction functions (e.g., glmnet) require the original formula;
predictions should be on probability scale, while "risk" will always be on
logit scale; overrides 
fit_ptreat 
a function of the form f(formula, data, ...) used for
fitting propensity (probability of treatment) models. If not specified,

pred_ptreat 
a function of the form f(model, data, formula) used for
generating propensity predictions. If not specified, 
ptreat 
(Optional) default value for probability of treatment; 
resp_ctl 
(Optional) 
resp_trt 
(Optional) default value for probability of response = 1
given each treatment regime ( 
calibrate 
whether or not to use platt scaling to calibrate predictions 
save_models 
whether or not fitted models should be returned 
recast_df 
(Optional) whether 
seed 
random seed to use 
... 
additional arguments passed to firststage model fitting function,

policy object
data 
original data frame, augmented with columns

risk_col 
either "resp_ctl" or "resp_trt", indicating which was used for "risk" 
treatment 
name of column from 
outcome 
name of column from 
grouping 
name of column from 
features 
additional features used in first stage model 
fit1 
function used to fit first stage model 
pred1 
function used to generate predictions from first stage model 
fit_ptreat 
function used to fit model for treatment propensity 
pred_ptreat 
function used to generate predictions for treatment propensity 
m_* 
if 
call 
the original call 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.