Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

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

Examples

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

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.