fit_brms: Fit a binary model for MRP

View source: R/fit_brms.R

fit_brmsR Documentation

Fit a binary model for MRP

Description

Internally, it creates a count version of the individual-data via ccesMRPprep::build_counts and then runs the regression in fit_brms_binomial.

Usage

fit_brms(
  .formula,
  .data,
  name_ones_as = "yes",
  name_trls_as = "n_response",
  ...
)

Arguments

.formula

Formula in ⁠binary y ~ (1|x1) + (1|x2)⁠ form.

.data

Individual-level dataset

name_ones_as

The name for the variable name for the number of successes

name_trls_as

The name for the variable name of the number of trials

...

Arguments passed on to fit_brms_binomial

.prior

prior specification that can be interpreted by brms. The default is a standard normal prior, which is tighter than the brms default but has shown to have good prior posterior draws

.cores

Number of cores to uses

.chains

Number of chains to pass on fit_brms

.iter

Number of total iterations.

.warmup

Of the iterations, how much are burn-ins. Defaults to half.

verbose

Whether to show iteration messages

.seed

seed for randomization to pass into brm

.backend

The backend argument of brms. Currently only "cmdstanr"

.threads

The number of threads to do within-chain parallelization. Defaults to not using, which is NULL

Examples

## Not run: 
fit <- fit_brms(response ~ (1|educ) + (1|cd), cces_GA)

## End(Not run)



kuriwaki/ccesMRPrun documentation built on Sept. 24, 2024, 2:15 a.m.