Package: dyadMLM 0.3.0.9000

dyadMLM: Tools for Dyadic Multilevel Models

Provides tools for dyadic multilevel modeling with linear and generalized linear mixed-effects models. It validates and prepares long-format cross-sectional and intensive longitudinal data, including ecological momentary assessment designs, for distinguishable and exchangeable dyads. It also supports datasets containing multiple observed dyad compositions. It constructs composition-aware, model-ready variables for Actor-Partner Interdependence Models (APIMs), Dyad-Individual Models (DIMs), and Dyadic Score Models (DSMs). Prepared data can be used with model engines such as 'glmmTMB' and 'brms' for Gaussian and non-Gaussian outcomes, including counts, proportions, and skewed continuous responses. Post-estimation tools compare compatible fitted models and back-transform exchangeable sum-and-difference random-effect covariance structures into member-level quantities. Experimental predictive checks compare observed and simulated response variances and partner correlations in Gaussian and selected non-Gaussian models. Distributional diagnostics separately check response distributions and residual patterns, using simulations that retain partner and time dependence. The APIM and DSM specifications and their relationships follow Iida et al. (2018) <doi:10.1177/0265407517725407>; the multilevel sum-and-difference random-effects implementation for exchangeable dyads adapts del Rosario and West (2025) <doi:10.1177/25152459251351286>.

Authors:Pascal Küng [aut, cre, cph]

dyadMLM_0.3.0.9000.tar.gz
dyadMLM_0.3.0.9000.zip(r-4.7-any)dyadMLM_0.3.0.9000.zip(r-4.6-any)dyadMLM_0.3.0.9000.zip(r-4.5-any)
dyadMLM_0.3.0.9000.tgz(r-4.6-any)dyadMLM_0.3.0.9000.tgz(r-4.5-any)
dyadMLM_0.3.0.9000.tar.gz(r-4.7-any)dyadMLM_0.3.0.9000.tar.gz(r-4.6-any)
dyadMLM_0.3.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
dyadMLM/json (API)

# Install 'dyadMLM' in R:
install.packages('dyadMLM', repos = c('https://pascal-kueng.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/pascal-kueng/dyadmlm/issues

Pkgdown/docs site:https://pascal-kueng.github.io

Datasets:
  • dyads_cross - Example Gaussian cross-sectional dyadic data
  • dyads_ild - Example Gaussian intensive longitudinal dyadic data
  • dyads_nbinom_cross - Example negative-binomial cross-sectional dyadic data
  • dyads_nbinom_ild - Example negative-binomial intensive longitudinal dyadic data

On CRAN:

Conda:

dyadicdyadic-datadyadic-modeldyadic-regression-analysisglmmtmbintensive-longitudinal-dataintensive-longitudinal-studiesopensciencestats

6.11 score 1 stars 19 scripts 266 downloads 7 exports 15 dependencies

Last updated from:fddbd2dab9. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK186
source / vignettesOK326
linux-releaseOK240
macos-releaseOK184
macos-oldrelOK190
windows-develOK192
windows-releaseOK211
windows-oldrelOK236
wasm-releaseOK137

Exports:check_dyad_outcomescheck_dyad_residualscheck_partner_dependencecompare_nested_modelsprepare_dyad_datarecover_exchangeable_covariancesimulate_dyad_responses

Dependencies:clidplyrgenericsgluelifecyclemagrittrpillarpkgconfigR6rlangtibbletidyselectutf8vctrswithr

Actor-Partner Interdependence Model (APIM)
Cross-sectional APIMs | The distinguishable APIM | Residual random-effects structure | Fitting the distinguishable APIM with glmmTMB | The exchangeable APIM | Modeling the residual random-effects structure | Fitting the restricted exchangeable APIM with glmmTMB | Testing distinguishability | Checking partner dependence | Checking residuals and outcomes | Intensive longitudinal APIMs | Concurrent ILD Gaussian APIM for distinguishable dyads | Adding role-specific residual AR(1) | Random slopes | Concurrent ILD Gaussian APIM for exchangeable dyads | Adding pooled residual AR(1) | Extension to exchangeable random slopes | Testing random-effect constraints | When carryover is the research question | References

Last update: 2026-10-28
Started: 2026-07-10

Dyad-Individual Model
Cross-Sectional Gaussian DIM | Example DIM Model | Model interpretation | Demonstrating model equivalence to APIM | Why Are These Models Equivalent? Exploring the Reparameterization | Random-effect transformation | Checking partner dependence | Intensive Longitudinal DIM | Interpretation of concurrent ILD DIM coefficients | APIM and DIM parameterizations in ILD | Including Random Slopes | Transforming DIM random slopes to APIM slopes | Dynamic ILD models | References

Last update: 2026-10-20
Started: 2026-07-10

Dyadic Score Model (DSM)
Preparing DSM Data | Cross-Sectional Gaussian DSM | Interpreting the DSM paths | $$\operatorname{Cov}(r_{\mathrm{m}},r_{\mathrm{d}}) | $$\operatorname{Cov}(e_{\mathrm{F}},e_{\mathrm{M}}) | Reversing the coding | Relationship to the APIM and DIM | Fixed-effect transformation | Random-effect transformation | $$\begin | Checking partner dependence | Intensive longitudinal DSM | References

Last update: 2026-10-20
Started: 2026-07-12

Getting Started
Installation | About this vignette | Prerequisites | Data preparation for distinguishable dyads | Data preparation for exchangeable dyads | Generating DIM and DSM columns | Intensive longitudinal dyadic data | Preparing lagged predictors | Working with multiple dyad compositions | Keeping only selected dyad compositions (filtering) | Setting distinguishable dyads to be treated as exchangeable | Pooling different dyad compositions | Citation | References

Last update: 2026-08-25
Started: 2026-07-08