View source: R/data_prep_validation.R
| validate_dyad_data | R Documentation |
Checks whether data has a valid long-format dyadic structure and returns it
as a tibble with an additional dyadMLM_data class. Cross-sectional data
may contain at most one row per member within each dyad. Intensive
longitudinal data may contain at most one row per member and measurement
occasion within each dyad.
validate_dyad_data(
data,
dyad,
member,
role = NULL,
time = NULL,
predictors = NULL,
lag1_predictors = NULL,
model_types = "apim",
dsm_role_order = NULL,
temporal_decomposition = c("auto", "2l", "none"),
incomplete_dyads = c("error", "drop"),
missing_role = c("error", "drop")
)
data |
A long-format data frame or tibble. |
dyad |
Column identifying the dyad. |
member |
Column identifying the two people or members within each dyad, such as a person ID. |
role |
Optional column identifying a stable member role, such as gender.
Non-missing values must be consistent within each |
time |
Optional column identifying time or measurement order. |
predictors |
Optional variables to select and store as metadata for temporal predictor decomposition and model-helper functions. |
lag1_predictors |
Optional subset of |
model_types |
Requested model-ready column families. Can contain one or
more of |
dsm_role_order |
For |
temporal_decomposition |
Requested temporal predictor decomposition
strategy for predictors. |
incomplete_dyads |
How to handle dyads with fewer than two unique
members across all rows in |
missing_role |
How to handle dyads in which at least one member has no
non-missing |
A tibble with class dyadMLM_data and metadata about the dyad,
member, optional role, and optional time columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.