add_dyadic_score_columns: Add dyadic-score model predictor columns and contrast

View source: R/data_prep_dsm.R

add_dyadic_score_columnsR Documentation

Add dyadic-score model predictor columns and contrast

Description

Adds Dyadic Score Model (DSM) dyad-mean and signed dyad-difference columns for the predictors recorded in a dyadMLM_data object, together with a DSM role contrast coded +0.5 and -0.5. DSM differences follow the role order recorded in attr(data, "dyadMLM")$dsm_role_order. The supported DSM structure contains one distinguishable dyad composition; exchangeable dyads and multiple compositions are not supported.

Usage

add_dyadic_score_columns(data)

Arguments

data

A dyadMLM_data object returned by prepare_dyad_data().

Details

For ILD predictors, raw and within-person scores are computed within dyad-time and between-person scores within dyad. Raw dyad means are grand-mean centered. Both partners' predictor values are required for each score pair. Selected lag predictors additionally create lag-1 raw and within-person dyad-mean and signed-difference columns.

Constructed predictor columns are recorded in attr(data, "dyadMLM")$dsm_predictors, and the contrast column name is recorded in attr(data, "dyadMLM")$dsm_role_contrast_column.

Value

A dyadMLM_data object with dyad-mean and signed dyad-difference predictor columns and a DSM role contrast added.


dyadMLM documentation built on Oct. 28, 2026, 1:06 a.m.