JointAI (version 0.5.1)

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 = 2,
  longnorm = 2, longbin = 2, longord = 2, longcount = 2,
  coef = NULL, misvar = NULL, nmisvar = 7, seed = NULL)

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 a character vector containing their names

multi

integer giving the number of multinomial variables or a character vector containing their names

ord

integer giving the number of ordinal variables or a character vector containing their names

count

integer giving the number of count variables or a character vector containing their names

longnorm

integer giving the number of longitudinal (normally distributed) variables or a character vector containing their names

longbin

integer giving the number of longitudinal binary variables or a character vector containing their names

longord

integer giving the number of longitudinal ordered factors or a character vector containing their names

longcount

integer giving the number of longitudinal count variables or a character vector containing their names

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 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

seed

optional seed value

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.