Description Usage Arguments Value Examples
get data for contrasts
1 2 3 |
stanreg |
stanreg object from rstanarm |
new_group |
a character vector of column names (factors) that should be
estimated "out of sample". If |
marginalize_factors |
a character manually choosing which factors to
marginalize over (collapsing numeric values by taking the mean for each
combination of factors). If |
margin_ignore |
character vector of numeric variable names to ingore when marginalizing over factors |
set_numerics |
an optional named list, where each name is the name of a column in the data and its value is the value to use to override the numeric value instead of using the margin. |
subset_expression |
an optional formula expression to subset the data
before marginalizing. Expressions must begin with a |
a data.table with the same columns used in the model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | stanreg <- example_stanreg()
model_data <- stanreg_dtbl(stanreg, TRUE) # compare below to model data
contrast_data(stanreg)
contrast_data(stanreg, new_group=TRUE)
contrast_data(stanreg, new_group=c('county'))
contrast_data(stanreg, margin_ignore = 'floor')
contrast_data(stanreg, TRUE, set_numerics = list(floor = 1))
contrast_data(stanreg, subset_expression = .~ log_uranium > 0)
contrast_data(stanreg, margin_ignore = c('floor'), subset_expression = 1:101)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.