MixMashNet: An R Package for Single and Multilayer Networks
The R package MixMashNet provides an integrated framework for estimating and analyzing single and multilayer networks using Mixed Graphical Models (MGMs), accommodating continuous, count, and categorical variables. In the multilayer setting, layers may comprise different types and numbers of variables, and users can explicitly impose a predefined multilayer topology. Bootstrap procedures are implemented to quantify sampling uncertainty for edge weights and node-level centrality indices. In addition, the package includes tools to assess the stability of node community membership and to compute community scores that summarize the latent dimensions identified through network clustering. MixMashNet also offers interactive Shiny applications to support exploration, visualization, and interpretation of the estimated networks.
💡 Research Summary
The paper introduces MixMashNet, an R package that unifies the estimation and analysis of both single‑layer and multilayer networks using Mixed Graphical Models (MGMs). Existing tools either focus on single‑layer networks, support only homogeneous variable types, or provide only visualization without statistical inference. MixMashNet fills this gap by allowing continuous, count, and categorical variables to be modeled jointly, and by enabling users to define arbitrary multilayer topologies where layers may contain different sets of nodes and variable types.
The core estimation engine builds on the mgm package, employing node‑wise generalized linear models with Elastic Net regularization (L1/L2 mixing controlled by α, overall penalty λ selected via cross‑validation or EBIC). To respect a predefined multilayer architecture, the authors implement a “masked MGM estimator”: for each node, a set of allowed predictors A_s is specified, and predictors outside this set are removed from the design matrix before fitting, ensuring that prohibited intra‑ or inter‑layer edges cannot appear in the final graph. Edge weights are derived by aggregating absolute regression coefficients from the two node‑wise regressions (AND/OR rule) and signs are assigned based on the direction of conditional association.
Multilayer networks are represented as a four‑tuple (V_M, E_M, V, α) or equivalently as a multilayer adjacency tensor. The package supports two main multilayer configurations: layer‑disjoint networks (different nodes per layer) and heterogeneous networks (nodes of mixed data types).
After network estimation, MixMashNet computes a suite of node‑level centrality measures (Strength, Closeness, Betweenness, Expected Influence) and implements five community‑detection algorithms (Louvain, Fast‑Greedy, Walktrap, Infomap, Edge Betweenness). It further provides bridge‑centrality indices (Bridge Strength, Bridge Closeness, Bridge Betweenness, 1‑step and 2‑step Bridge Expected Influence) that quantify a node’s role in connecting distinct communities. Nodes whose community assignment is unstable across bootstrap samples are labeled “excluded nodes”; analogous bridge metrics are calculated for them as well.
Uncertainty quantification is achieved through a unified bootstrap framework. The entire estimation pipeline (including regularization parameter selection) is repeated on B resampled datasets (default 1000). For each bootstrap replicate, edge weights, centrality scores, and community partitions are stored, allowing the computation of means, standard deviations, confidence intervals, and stability scores for every network feature.
Visualization is handled via ggplot2 for static plots and an interactive Shiny application. Users can map node attributes (centrality, community) to color and size, adjust edge thickness by weight, select layers, choose community algorithms, and explore bootstrap distributions through histograms or boxplots.
The authors demonstrate the package on two real‑world examples: (1) a single‑layer psychological questionnaire dataset, illustrating bootstrap‑based edge stability and centrality confidence intervals; and (2) a three‑layer biological dataset comprising genetic, phenotypic, and environmental variables, showcasing the ability to model heterogeneous data, enforce a predefined inter‑layer connectivity pattern, and identify bridge nodes that link functional modules across layers. In both cases, bootstrap results indicate narrow confidence intervals for key edges and centralities, supporting the reliability of the inferred networks.
In summary, MixMashNet integrates mixed‑type data handling, flexible multilayer topology specification, penalized high‑dimensional estimation, comprehensive centrality and community analysis, bootstrap‑driven uncertainty assessment, and interactive visualization into a single R package. This makes it a valuable tool for researchers across psychology, biology, social sciences, and any field dealing with complex, heterogeneous, multilayered data structures.
Comments & Academic Discussion
Loading comments...
Leave a Comment