Skip to contents

Specifies a multiple-membership level in the model where group-level units (e.g., governments) are composed of multiple member-level units (e.g., political parties). Unlike pure hierarchical nesting, members can belong to multiple groups, and their contributions are aggregated using a user-specified weight function.

Usage

mm(id, vars = NULL, fn = NULL, RE = NULL, ar = FALSE)

Arguments

id

An id object specifying the member-level and group-level identifiers: id(mmid, mainid) where mmid identifies members and mainid identifies groups.

vars

A vars object specifying member-level covariates to aggregate, or NULL for random effects only. Supports interactions (*, :) and transformations (I()). Variables are weighted according to the function specified in fn.

fn

A fn object specifying the weight function (default: fn(w ~ 1/n, c = TRUE) for equal weights). Note: Weight functions do NOT support interactions or I() - pre-create any needed transformed variables in your data. See fn for details.

RE

Logical; if TRUE, include random effects for member-level units. Automatically set to TRUE if vars = NULL (random effects only).

ar

Logical; if TRUE, random effects evolve autoregressively across participations. Requires members to have sequential participation indicators in the data. Default: FALSE.

Value

A bml_mm object containing the multiple-membership specification.

Details

Multiple-Membership Models:

In standard hierarchical models, each observation belongs to exactly one group. Multiple-membership models relax this assumption, allowing groups to be composed of multiple members, with flexible weighting of member contributions.

Model Structure:

The contribution from mm block \(k\) to group \(j\) is:

$$\mathrm{mm}_{kj} = \sum_{i \in group_j} w_{ki} (x_{ki}' \beta_k + \alpha_{ki})$$

where:

  • \(w_{ki}\): Weight for member \(i\) in group \(j\) (from fn)

  • \(x_{ki}\): Member-level covariates (from vars)

  • \(\beta_k\): Regression coefficients (estimated)

  • \(\alpha_{ki}\): Member-level random effect (if RE = TRUE)

Multiple mm() Blocks:

You can specify multiple mm() blocks with different weight functions, variables, or random effect specifications. This allows modeling different aggregation mechanisms simultaneously.

References

Rosche, B. (2026). A Multilevel Model for Theorizing and Estimating the Micro-Macro Link. Political Analysis.

Browne, W. J., Goldstein, H., & Rasbash, J. (2001). Multiple membership multiple classification (MMMC) models. Statistical Modelling, 1(2), 103-124.

Fielding, A., & Goldstein, H. (2006). Cross-classified and multiple membership structures in multilevel models: An introduction and review. Research Report RR791, Department for Education and Skills.

See also

Examples

if (FALSE) { # \dontrun{
# 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
)
} # }