# \donttest{
# Equal weights with variables
mm(
id = id(pid, gid),
vars = vars(rile + ipd),
fn = fn(w ~ 1/n, c = TRUE),
RE = FALSE
)
# Random effects only (no variables)
mm(
id = id(pid, gid),
vars = NULL,
fn = fn(w ~ 1/n, c = TRUE),
RE = TRUE # Automatically TRUE when vars = NULL
)
# Flexible weights with parameter
mm(
id = id(pid, gid),
vars = vars(org_structure),
fn = fn(w ~ ilogit(b0 + b1 * pseat), c = TRUE),
RE = TRUE
)
# Autoregressive random effects
mm(
id = id(pid, gid),
vars = NULL,
fn = fn(w ~ 1/n, c = TRUE),
RE = TRUE,
ar = TRUE # Random effects evolve over participations
)
# Interactions and transformations in vars
mm(
id = id(pid, gid),
vars = vars(rile * ipd), # Main effects plus interaction
fn = fn(w ~ 1/n, c = TRUE),
RE = FALSE
)
mm(
id = id(pid, gid),
vars = vars(rile + I(rile^2)), # Quadratic term
fn = fn(w ~ 1/n, c = TRUE),
RE = FALSE
)
# }
Run the code above in your browser using DataLab