Skip to contents

Runs Bayesian hierarchical mixed model with up to three conditions and nested factors (groups).Uses rstanarm

Usage

bayes_mm_run(
  data,
  dvname,
  conditions,
  groups,
  f = NULL,
  mmtype = "intercept",
  binom = F,
  adapt_delta = 0.8,
  explore_browser = F,
  iter = 2000
)

Arguments

data

data in long format

dvname

column name for DV

conditions

up to 3 conditions

groups

a set of random factors

f

formula, if omitted this will be generated for you

mmtype

default to random intercepts, but can have 'slopes' too

binom

If true uses the binomial / logit family

adapt_delta

defults to 0.8, but can get closer to 1 if convergences probs

explore_browser

launch a browser interface to explore model (uses shinystan)

iter

iterations for the model to run

Value

Returns the bayes model