Skip to contents

Generate data for a single group

Usage

generate_data_single(pars_group, strategy_fun = NULL, distr_pars_ref = NULL)

Arguments

pars_group

A simul_pars object as generated by set_simul_pars(). It specifies the simulation parameters of the given group.

strategy_fun

Function implementing trajectories after the intercurrent event (ICE). Must be one of getStrategies(). See getStrategies() for details. If NULL then post-ICE outcomes are untouched.

distr_pars_ref

Optional. Named list containing the simulation parameters of the reference arm. It contains the following elements:

  • mu: Numeric vector indicating the mean outcome trajectory assuming no ICEs. It should include the outcome at baseline.

  • sigma Covariance matrix of the outcome trajectory assuming no ICEs. If NULL, then these parameters are inherited from pars_group.

Value

A data.frame containing the simulated data. It includes the following variables:

  • id: Factor variable that specifies the id of each subject.

  • visit: Factor variable that specifies the visit of each assessment. Visit 0 denotes the baseline visit.

  • group: Factor variable that specifies which treatment group each subject belongs to.

  • outcome_bl: Numeric variable that specifies the baseline outcome.

  • outcome_noICE: Numeric variable that specifies the longitudinal outcome assuming no ICEs.

  • ind_ice1: Binary variable that takes value 1 if the corresponding visit is affected by ICE1 and 0 otherwise.

  • dropout_ice1: Binary variable that takes value 1 if the corresponding visit is affected by the drop-out following ICE1 and 0 otherwise.

  • ind_ice2: Binary variable that takes value 1 if the corresponding visit is affected by ICE2.

  • outcome: Numeric variable that specifies the longitudinal outcome including ICE1, ICE2 and the intermittent missing values.

See also