Learn R Programming

rstanarm (version 2.9.0-3)

example_model: Example model

Description

A pre-fit model for use in rstanarm examples.

Arguments

format

A stanreg object containing the output from fitting the model in the Examples section, below. The chains and iter arguments are specified to make this example be small in size. In practice, we recommend that they be left unspecified in order to use the default values (4 and 2000 respectively) or increased if there are convergence problems. The cores argument is optional and on a multicore system, the user may well want to set that equal to the number of chains being executed.

See Also

cbpp for a description of the data.

Examples

Run this code
example_model <- 
  stan_glmer(cbind(incidence, size - incidence) ~ size + period + (1|herd),
             data = lme4::cbpp, family = binomial,
             # this next line is only to keep the example small in size!
             chains = 2, cores = 1, seed = 12345, iter = 500)
example_model

Run the code above in your browser using DataLab