Function to estimate a Bayesian case-control model.
Usage
fit(
data = data_sim,
contamination = F,
show_code = T,
offset = F,
beta_prior = "normal",
small_area_prior = "fixed",
large_area_prior = NA,
intercept_scale = NA,
iter = 100,
warmup = 50,
thin = 4,
cores = 4,
chains = 4,
control = list(max_treedepth = 7, adapt_delta = 0.8),
verbose = TRUE
)
Arguments
- data
list, survey and shapefile combined list object created with the
data.prep()
function.- contamination
logical, should the model include the Rota et al. (2013) style contamination layer? Defaults to
TRUE
.- show_code
logical, should the stan code print on the screen at the end of the run? Defaults to
TRUE
.- offset
logical, should the model include a King and Zeng (2001) style offset ? if contamination is also specified, this will be a contaminated-offset. Defaults to
TRUE
.- beta_prior
string, what prior should the regression coefficients have? Choice between: "normal" and "cauchy."
- small_area_prior
string, what should be the small-area effects type? Choice between: "fixed," "random," "ICAR," and "BYM2." Specify
NA
for no area effects. Defaults to "fixed.- large_area_prior
string, what should be the large-area effects type? Choice between: "fixed" and "random." Specify
NA
for no area effects. Defaults toNA
.- intercept_scale
integer, scale of intercept; see
?stan
for further information.- iter
integer, number of draws; see
?stan
for further information.- warmup
number of warmup draws; see
?stan
for further information.- thin
integer, number to thin draws; see
?stan
for further information.- cores
integer, number of cores to use; see
?stan
for further information.- chains
integer, number of chains; see
?stan
for further information.- control
list; tree depth and adapt delta; see
?stan
for further information.- verbose
logical, print full stan output? Defaults to
TRUE
.