generate_data: Generate data

Description Usage Arguments Value Examples

Description

Generates data using the mvrnorm function from the MASS package according to user-specified means and effect sizes (ie. differences in means) for variables.

Usage

1
2
generate_data(num_samples_trt, num_samples_control, means, delta,
  cor_matrix = NULL, num_reps = 1000)

Arguments

num_samples_trt

The number of samples in the group that has an effect applied to the mean specified.

num_samples_control

The number of samples in the group that maintains the mean specified by the user.

means

A vector specifying the mean for each feature in the dataset.

delta

A vector specifying the difference in the mean for each feature in the dataset.

cor_matrix

The correlation matrix. If not specified an appropriately sized identity matrix is generated. Default: NULL

num_reps

Number of repetitions of the data that will be generated. Default: 1000

Value

A dataframe with (num_samples_trt+num_samples_control)*num_reps rows and length(means) columns as well as a column for sample number, treatment assignment, iteration number, and total number of samples n.

Examples

1
generate_data(50, 50, c(1, 2, 3), c(0.3, 0, 0.7))

emartchenko/mvsimstudy documentation built on May 24, 2019, 5:04 a.m.