umx_scale_wide_twin_data: Scale wide twin data

umx_scale_wide_twin_dataR Documentation

Scale wide twin data

Description

Scale wide data across all twins. You offer up a list of variables to scale, e.g. c("DEP", "bmi") and the separator (e.g. sep = "_T") and twin suffixes e.g. 1:2 that paste together to make complete variable names: e.g. "DEP_T1" and "DEP_T2".

Usage

umx_scale_wide_twin_data(varsToScale, sep, data, twins = 1:2)

Arguments

varsToScale

The base names of the variables ("weight" etc.)

sep

The suffix that distinguishes each case, e.g. "_T")

data

A wide dataframe

twins

Legal digits following sep (default 1:2)

Value

  • dataframe with varsToScale standardized

References

See Also

umx_scale

Other Twin Data functions: umx, umx_long2wide(), umx_make_TwinData(), umx_make_twin_data_nice(), umx_residualize(), umx_wide2long()

Examples

data(twinData) 
df = umx_scale_wide_twin_data(data = twinData, varsToScale = c("ht", "wt"), sep = "")
plot(wt1 ~ wt2, data = df)

tbates/umx documentation built on Dec. 14, 2024, 11:28 a.m.