dyadMLM 0.3.1
recover_exchangeable_covariance()now warns when aglmmTMBmodel also has a term with a time structure, such asar1()orou(). The recovered same-occasion covariance does not include that term’s variance (#199).prepare_dyad_data()now rejects role labels that start withx_or end with_x. Combined with other labels, they could give two different compositions the same label (#173).prepare_dyad_data()now removes leading and trailing spaces fromrolevalues and says so in a message. Before, a label such as"mother "counted as a role of its own, and labels with such spaces were reported as unknown inkeep_compositionsanddsm_role_order(#62).Composition labels, generated column names, factor levels, and the order of roles in the model checks no longer depend on the machine’s language settings. Role labels are now sorted ignoring case, the same way on every machine. Labels with capital letters,
_or non-ASCII letters can therefore be ordered differently than before (thanks to @asimht, #174).In diary data prepared for the DIM or DSM, the lagged dyad-mean column
.{x}_dyad_mean_gmc_lag1is now centered on the same mean as.{x}_dyad_mean_gmc, so it is the lag of that column. Its values shift by a constant. The slope of this column does not change, but other estimates can, for example the intercept (#172).recover_exchangeable_covariance()now warns about singular fits inglmmTMBmodels: when a recovered standard deviation is practically zero (Gaussian models only), and when a partner correlation is +1 or -1 (#170).check_dyad_outcomes()warns when fewer than 39 simulated datasets are supplied, because the 95% limits are then infinite and nothing can be flagged (thanks to @Soham1660, #180).recover_exchangeable_covariance()now warns when a GaussianglmmTMBmodel has a residual variance that the recovered residual-level covariance leaves out. This happens when the model is fitted withoutdispformula = ~ 0. Member variances were then too small and partner correlations too far from zero (#162).recover_exchangeable_covariance()now gives a message when abrmsmodel has anunstr()term, because the residual correlation is then read from the model summary. The advice to refit withunstr()now gives the reason and is shown for Gaussian models only (#162).Fixed
prepare_dyad_data()treating occasions a person missed as observed when thedyad,member, ortimecolumn is also a predictor. Lags, means, and partner values of such a predictor now use observed rows only, as for any other predictor (#117).Fixed
prepare_dyad_data()treating occasions a person missed as observed when therolecolumn is also a predictor in diary data. Its lags and partner values now use observed rows only (#152).simulate_dyad_responses()now stops for models fitted withREML = TRUE. For these fits,predicted_responsedid not match the fitted model, which affectedcheck_partner_dependence(),check_dyad_outcomes()andcheck_dyad_residuals(). Refit withREML = FALSE(#164).Fixed
compare_nested_models()stopping with “The larger model has a lower log-likelihood” when the larger model adds nothing, for example a variance estimated at zero. The statistic is then 0 and the p-value 1. The help now names aglmmTMBsetting that often helps when a Gaussian model withdispformula = ~ 0does not converge (#163).Documentation: the APIM vignette now shows
ou()for unequally spaced occasions and the whole same-day residual in the AR(1) example. Its note on random-effect comparisons now says that their p-values are too large. The diary models in the vignettes setzerodisp_valto avoid false convergence. The within-dyad effect quoted in the DIM vignette is corrected. Several help pages gained cautions, for example on where.member_contrast_*columns may be used (thanks to @asimht, @sridhar007-ah and @Voyagerroc, #181, #185, #188, #193, #194, #195, #197, #198).
dyadMLM 0.3.0
CRAN release: 2026-10-27
prepare_dyad_data()now rejects pool names that match generated role labels in other compositions, preventing distinct groups from silently sharing an indicator column (thanks to @JorAlEs, #108).Changed the package license from MIT to GPL-3.
Added experimental
simulate_dyad_responses()andcheck_partner_dependence()to check response variances and partner correlations inglmmTMBmodels with Gaussian or selected non-Gaussian responses, including ordinal, zero-inflated, and hurdle models. Checks can be performed separately for each dyad composition. For repeated occasions, supplymemberandtimetocheck_partner_dependence()to check member means and same-occasion deviations separately.Added experimental
check_dyad_residuals()for simulated probability integral transform (PIT) residuals andcheck_dyad_outcomes()for response distributions, SDs, extremes, and zero counts. Both use the output fromsimulate_dyad_responses(). The PIT residuals follow Florian Hartig’s DHARMa approach and Dunn and Smyth’s (1996) randomized quantile residuals, but the simulations and reference distributions account for the dyadic and temporal dependence the model includes. DHARMa is not required. A simulation study evaluates sensitivity and false-positive flags.Added
quartile_lines = "qgam"tocheck_dyad_residuals()to fit the PIT quartile lines with the qgam package, as DHARMa does. These lines can show trends near the ends of a numeric axis more clearly, but take much longer, and their envelopes are approximate.Improved function help and the model-comparison example (thanks to @musanyaks, #50).
Fixed an internal vctrs error in
prepare_dyad_data()when no member rows are missing and the data contain, for example, anhmscolumn while the hms package is not loaded.Fixed
recover_exchangeable_covariance()accepting a custom shared indicator with values other than 0 and 1, such as 0.5, whendifference_block = NULL. It now gives an error.Fixed predictive means for
glmmTMB1.1.15.2 and later when the zero-inflation component has random effects but no fixed effects.Fixed
compare_nested_models()reporting a likelihood-ratio test forglmmTMBmodels fitted withpriors. It now asks to refit them without priors.Fixed
prepare_dyad_data()silently using another column whenpredictorsorlag1_predictorsrenamed a column, as inc(z = x). Renaming now gives an error.Fixed
prepare_dyad_data()failing when an APIM predictor is also thedyad,member, ortimecolumn, as in growth models that use time as a predictor.Fixed
prepare_dyad_data()failing with dplyr 1.1.0. dyadMLM now requires dplyr 1.1.1 or later.Fixed
prepare_dyad_data()keeping incomplete dyads despiteincomplete_dyads = "drop"when thedyadcolumn was namedn_members. Messages and metadata also showed member counts instead of dyad IDs.prepare_dyad_data()now gives a clear error whendatais supplied twice, for example through the pipe and as an argument.prepare_dyad_data()warns when all lag-1 values of a predictor are missing, for example whentimecounts years with two-year waves (#83).Fixed
recover_exchangeable_covariance()accepting member contrasts fromprepare_dyad_data()when no fitted group contained both partners, for example in a model grouped by person instead of couple. It now gives an error.
dyadMLM 0.2.0
CRAN release: 2026-08-21
This early API-stabilization release intentionally makes a few direct, breaking changes from 0.1.0. Compatibility wrappers are not retained.
Retained generated columns now use a single leading dot instead of
.dy_for more readable model formulas. For example,.dy_x_actorbecomes.x_actor. The.dy_prefix is reserved for temporary implementation columns.prepare_dyad_data()now uses compact composition-column names when the final data contain one composition, such as.is_femaleand.member_contrast_arbitrary. Setshort_colnames = FALSEto retain composition-qualified names.recover_exchangeable_covariance()recognizes both forms.prepare_dyad_data(include_arbitrary_member_contrast = TRUE)can now add arbitrary member contrasts for distinguishable compositions without changing their metadata or role indicators. This supports full and exchangeability-constrained APIMs from the same prepared data.set_exchangeable_compositionsstill performs reclassification for pooling and DIM preparation.Added a
summary()method for prepared data that prints the dyadic structure followed by standard summaries of all columns.Printing prepared data now uses current dyad and composition counts. If a required column has been removed, the unavailable summary is identified instead of displaying its preparation-time count.
Generated-column tracking now records all retained composition and modeling columns. Printing and model comparison use these records rather than inferring column ownership from a prefix, and generated names are checked for collisions and valid R syntax before they are written.
prepare_dyad_data(add_apim_gmc_predictors = TRUE)now adds GMC source, actor, and partner columns alongside raw APIM columns, plus lagged variants when requested. It uses one mean over retained non-missing values, warns about skipped non-numeric predictors in mixed selections, and leaves DIM/DSM centering unchanged.For longitudinal data,
prepare_dyad_data()now temporarily adds an all-missing partner row when only one member is present at an observed dyad-occasion. This preserves partner CBP values and exact source-occasion APIM, DIM, and DSM lags. Temporary rows are removed before the prepared data are returned. This is structural completion for column construction, not imputation or the addition of analysis rows.Numeric structural columns and numeric predictors selected for preparation now reject
Infand-Infbefore model-ready columns are generated. Errors identify the affected columns and input rows;NAandNaNremain supported as missing predictor values.Renamed
compare_nested_glmmTMB_models()tocompare_nested_models(). Its printed conclusion now uses a configurablealphalevel and no longer recommends a model solely because the likelihood-ratio test is not significant.recover_exchangeable_covariance()now returns anexchangeable_covarianceobject instead of anexchangeable_rescovobject, with a clearer member-level print heading.For
brmsmodels,recover_exchangeable_covariance()now returns posterior- mean matrices by default. Useposterior = "median"or"draws"for the corresponding alternatives.Added package-level help at
?dyadMLM, with links to the main functions, example datasets, and getting-started documentation.Example datasets no longer include the redundant
dyad_compositioncolumn. Instead,dyads_ildnow includes member-specific AR(1) residual processes.
dyadMLM 0.1.0
CRAN release: 2026-07-30
- Initial release.
- Cleaned up the pre-release public API with these direct migration mappings:
grouptodyad,lag_predictorstolag1_predictors,model_typetomodel_types,temporal_predictor_decompositiontotemporal_decomposition,"time_2l"to"2l",include_compositionstokeep_compositions,compare_dyad_models()tocompare_nested_glmmTMB_models(),exchangeable_rescov()torecover_exchangeable_covariance(),pairstoblock_pairings, pairing fieldssharedanddifferencetoshared_blockanddifference_block, and print argumentwhattorepresentation. - Renamed generated exchangeable-member contrasts from
.dy_diff_{composition}_arbitraryto.dy_member_contrast_{composition}_arbitrary. - Renamed the package from
interdeptodyadMLM. Package-generated columns now use the.dy_prefix instead of.i_. - Added validation and preparation of cross-sectional and intensive longitudinal dyadic data with distinguishable, exchangeable, and mixed dyad compositions.
- Added composition filtering, exchangeability overrides, and pooling.
- Exchangeable-dyad difference columns now use an
_arbitrarysuffix. - Added temporal predictor decomposition and model-ready columns for APIM, DIM, and DSM parameterizations.
- Added
compare_nested_glmmTMB_models()for compatible nestedglmmTMBmodels andrecover_exchangeable_covariance()for back-transforming shared/difference random-effect covariance structures. - Added example datasets, getting-started and model-specific vignettes, and a concise print method for prepared data.