Learn R Programming

umx (version 1.9.1)

umxPadAndPruneForDefVars: umxPadAndPruneForDefVars

Description

Replaces NAs in definition slots with the mean for that variable ONLY where all data are missing for that twin

Usage

umxPadAndPruneForDefVars(df, varNames, defNames, suffixes, highDefValue = 99,
  rm = c("drop_missing_def", "pad_with_mean"))

Arguments

df

the dataframe to process

varNames

list of names of the variables being analysed

defNames

list of covariates

suffixes

suffixes that map names on columns in df (i.e., c("T1", "T2"))

highDefValue

What to replace missing definition variables (covariates) with. Default = 99

rm

= how to handle missing values in the varNames. Default is "drop_missing_def", "pad_with_mean")

Value

- dataframes

References

- http://tbates.github.io, https://github.com/tbates/umx

See Also

Other Data Functions: umxCovData, umxFactor, umxHetCor, umx_as_numeric, umx_cont_2_quantiles, umx_cov2raw, umx_long2wide, umx_lower2full, umx_make_MR_data, umx_make_TwinData, umx_make_bin_cont_pair_data, umx_make_fake_data, umx_merge_CIs, umx_read_lower, umx_reorder, umx_residualize, umx_round, umx_scale_wide_twin_data, umx_scale, umx_swap_a_block, umx_wide2long, umx

Examples

Run this code
# NOT RUN {
df = umxPadAndPruneForDefVars(df, "E", "age", c("_T1", "_T2"))
# }

Run the code above in your browser using DataLab