- nsub
Number of subjects
- nlevels
Number of treatment groups or levels on the treatment variable X.
Subjects are assumed to be randomly assigned to each level with equal
probability (i.e., the probability per level is 1/nlevel). Default is 2 for
a randomized controlled trial with a control group X=0 and an experimental
group X=1. There should not be less than 2 or more than 5 groups for purposes
of this function.
- ntimes
Number of potential times that could be observed on each subject
- observe_rate
Proportion of potential times on which there are actually
observations. Not all times are observed; this is assumed to be completely random and
to be done by design to reduce participant burden.
- alpha_int
Function representing the time-varying mean of mediator variable
for the level of treatment with all treatment dummy codes X set to 0 (e.g., the
control group).
- alpha_X
Function representing the time-varying effect of X on the
mediator (if there are two treatment levels) or a list of nlevels-1
functions representing the effect of receiving each nonzero level of X rather
than control (if there are more than two treatment levels).
- beta_M
Function representing the functional coefficient for cumulative
(scalar-on-function) effect of the mediator M on the treatment Y adjusting
for the treatment X
- beta_int
Mean of Y if the X is zero and M is the 0 function
- beta_X
Numeric value representing the direct effect of X on Y after adjusting
for M (if there are two treatment levels) or a vector of nlevels-1 numeric values
(if there are more than two treatment levels)
- sigma_Y
Error standard deviation of the outcome Y (conditional on
treatment and mediator trajectory)
- sigma_M_error
Error standard deviation of the mediator M (conditional
on treatment and time)
- rho_M_error
Autoregressive correlation coefficient of the error
in the mediator M, from one observation to the next
- simulate_binary_Y
Whether Y should be generated from a binary
logistic (TRUE) or Gaussian (FALSE) model
- make_covariate_S
Whether to generate a random binary covariate S
at the subject (i.e., time-invariant) level. It will be generated to have
zero population-level relationship to the outcome.