umx_make_fake_data: umx_make_fake_data

umx_make_fake_dataR Documentation

umx_make_fake_data

Description

This function takes as argument an existing dataset, which must be either a matrix or a data frame. Each column of the dataset must consist either of numeric variables or ordered factors. When one or more ordered factors are included, then a heterogeneous correlation matrix is computed using John Fox's polycor package. Pairwise complete observations are used for all covariances, and the exact pattern of missing data present in the input is placed in the output, provided a new sample size is not requested. Warnings from the polycor::hetcor function are suppressed.

Usage

umx_make_fake_data(
  dataset,
  digits = 2,
  n = NA,
  use.names = TRUE,
  use.levels = TRUE,
  use.miss = TRUE,
  mvt.method = "eigen",
  het.ML = FALSE,
  het.suppress = TRUE
)

Arguments

dataset

The original dataset of which to make a simulacrum

digits

= Round the data to the requested digits (default = 2)

n

Number of rows to generate (NA = all rows in dataset)

use.names

Whether to name the variables (default = TRUE)

use.levels

= Whether to use existing levels (default = TRUE)

use.miss

Whether to have data missing as in original (defaults to TRUE)

mvt.method

= Passed to hetcor (default = "eigen")

het.ML

= Passed to hetcor (default = FALSE)

het.suppress

Passed to hetcor (default = TRUE)

Value

- new dataframe

See Also

[OpenMx::mxGenerateData()]

Other Data Functions: noNAs(), prolific_anonymize(), prolific_check_ID(), prolific_read_demog(), umxFactor(), umxHetCor(), umx_as_numeric(), umx_cont_2_quantiles(), umx_lower2full(), umx_make_MR_data(), umx_make_TwinData(), umx_make_raw_from_cov(), umx_merge_randomized_columns(), umx_polychoric(), umx_polypairwise(), umx_polytriowise(), umx_read_lower(), umx_rename(), umx_reorder(), umx_score_scale(), umx_select_valid(), umx_stack(), umx_strings2numeric(), umx

Examples

fakeCars = umx_make_fake_data(mtcars)

umx documentation built on May 29, 2024, 5:40 a.m.