Convert inputs for baggr models
Converts data to Stan inputs, checks integrity of data and suggests default model if needed. Typically all of this is done automatically by baggr, this function is only for debugging or running models "by hand".
convert_inputs( data, model, quantiles, group = "group", outcome = "outcome", treatment = "treatment", covariates = c(), test_data = NULL, silent = FALSE )
data |
'data.frame“ with desired modelling input |
model |
valid model name used by baggr;
see baggr for allowed models
if |
quantiles |
vector of quantiles to use (only applicable if |
group |
name of the column with grouping variable |
outcome |
name of column with outcome variable (designated as string) |
treatment |
name of column with treatment variable |
covariates |
Character vector with column names in |
test_data |
same format as |
silent |
Whether to print messages when evaluated |
Typically this function is only called within baggr and you do not need to use it yourself. It can be useful to understand inputs or to run models which you modified yourself.
Witold Wiecek
# simple meta-analysis example, # this is the formatted input for Stan models in baggr(): convert_inputs(schools, "rubin")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.