Learn R Programming

JointAI (version 0.1.0)

sim_data: Simulate dataset

Description

Simulate dataset

Usage

sim_data(N = 100, Jmin = 1, Jmax = 6, tmin = 0, tmax = 5, norm = 2,
  bin = 2, multi = 2, ord = 2, count = NULL, long = 2, coef = NULL,
  misvar = NULL, nmisvar = 7, format = "long")

Arguments

N

sample size (integer)

Jmin

minimum number of repeated measurements in longitudinal variable

Jmax

maximum number of repeated measurements in longitudinal variable

tmin

minimum of time variable

tmax

maximum of time variable

norm

integer giving the number of normally distributed variables to create or list of parameters to create normally distributed variables from. If norm is an integer, the mean and standard deviation are drawn from distributions.

bin

integer giving the number of binary variables or list

multi

integer giving the number of multinomial variables or list

ord

integer giving the number of ordinal variables or list

count

integer giving the number of ordinal variables or list (not yet used)

long

integer giving the number of longitudinal (normally distributed) variables or list containing parameters

coef

vector of parameters used to create the outcome (optional), if NULL, the parameters are drawn from a normal distribution

misvar

vector of variable names or positions (??? check this) to specify which variables are incomplete

nmisvar

integer specifying the total number of incomplete variables, necessary when misvar is NULL and incomplete variables are chosen randomly

format

"long" or "wide" ("wide" not yet implemented)

Details

The time variable has a uniform distribution between tmin and tmax. At the moment only the integer option is implemented for the parameters norm, bin, multi, etc.