center_predictors: Center predictor variables for dyadic models

View source: R/data_prep_centering.R

center_predictorsR Documentation

Center predictor variables for dyadic models

Description

Adds centered predictor columns to a dyadMLM_data object. It currently supports two-level temporal centering for intensive longitudinal predictors: a within-person component and a between-person component. The original predictor remains available as a raw component for model-specific column construction. It can also add GMC source components for numeric APIM predictors. For two-level temporal centering, the between-person component is centered around the grand mean of person means, not the grand mean of all observed rows. This gives each person equal weight even when people have different numbers of observed measurement occasions.

Usage

center_predictors(data, add_apim_gmc_predictors = FALSE)

Arguments

data

A dyadMLM_data object returned by prepare_dyad_data().

add_apim_gmc_predictors

Whether to add APIM GMC source components.

Details

The function uses the structural metadata stored by prepare_dyad_data().

Value

A dyadMLM_data object with centered predictor columns added and updated predictor metadata.


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