add_actor_partner_columns: Add actor and partner predictor columns

View source: R/data_prep_apim.R

add_actor_partner_columnsR Documentation

Add actor and partner predictor columns

Description

Adds APIM-style actor and partner columns for the predictors recorded in an dyadMLM_data object. For uncentered predictors, this will create actor and partner versions of the raw predictor. For centered intensive longitudinal predictors, this will create actor and partner versions of the raw predictor and each recorded predictor component, such as the within-person and between-person components created by center_predictors(). Selected lag predictors also create actor and partner columns for eligible lagged components.

Usage

add_actor_partner_columns(data)

Arguments

data

A dyadMLM_data object returned by prepare_dyad_data().

Details

The function will use the predictor decomposition metadata stored in attr(data, "dyadMLM")$temporal_decompositions, so downstream code does not need to infer generated predictor columns from their names. It stores the constructed APIM columns in attr(data, "dyadMLM")$apim_predictors.

Value

A dyadMLM_data object with actor and partner predictor columns added and APIM predictor metadata recorded.


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