Learn R Programming

umx (version 4.20.0)

umx_scale_wide_twin_data: 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)

Value

  • dataframe with varsToScale standardized

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)

References

See Also

umx_scale

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

Examples

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

Run the code above in your browser using DataLab