Changed the package license from MIT to GPL-3.
Added experimental check_dyad_residuals() for simulated probability
integral transform (PIT) residuals and check_dyad_outcomes() for response
distributions, SDs, extremes, and zero counts. Both use the output from
simulate_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" to check_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).
Added experimental predictive checks for response variances and partner
correlations in cross-sectional glmmTMB models with Gaussian or selected
non-Gaussian responses, including ordinal, zero-inflated, and hurdle models.
Checks and plots can be shown separately for each dyad composition. Printed
checks list each observed summary with the middle 95% of its simulations, and
the same comparison is stored in summary.
Fixed an internal vctrs error in prepare_dyad_data() when no member rows
are missing and the data contain, for example, an hms column while the hms
package is not loaded.
Fixed predictive means for glmmTMB 1.1.15.2 and later when the
zero-inflation component has random effects but no fixed effects.
prepare_dyad_data() now gives a clear error when data is supplied
twice, for example through the pipe and as an argument.
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_actor becomes
.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_female and
.member_contrast_arbitrary. Set short_colnames = FALSE to 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_compositions still 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 Inf and -Inf before model-ready columns are generated. Errors
identify the affected columns and input rows; NA and NaN remain supported
as missing predictor values.
Renamed compare_nested_glmmTMB_models() to compare_nested_models().
Its printed conclusion now uses a configurable alpha level and no longer
recommends a model solely because the likelihood-ratio test is not
significant.
recover_exchangeable_covariance() now returns an
exchangeable_covariance object instead of an exchangeable_rescov object,
with a clearer member-level print heading.
For brms models, recover_exchangeable_covariance() now returns posterior-
mean matrices by default. Use posterior = "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_composition column.
Instead, dyads_ild now includes member-specific AR(1) residual processes.
group to dyad, lag_predictors to lag1_predictors, model_type to
model_types, temporal_predictor_decomposition to
temporal_decomposition, "time_2l" to "2l", include_compositions to
keep_compositions, compare_dyad_models() to
compare_nested_glmmTMB_models(), exchangeable_rescov() to
recover_exchangeable_covariance(), pairs to block_pairings, pairing
fields shared and difference to shared_block and difference_block,
and print argument what to representation..dy_diff_{composition}_arbitrary to
.dy_member_contrast_{composition}_arbitrary.interdep to dyadMLM. Package-generated columns
now use the .dy_ prefix instead of .i_._arbitrary suffix.compare_nested_glmmTMB_models() for compatible nested glmmTMB models and
recover_exchangeable_covariance() for back-transforming shared/difference random-effect
covariance structures.