Description Usage Arguments Value
This internal function simulates a new dataset containing covariates, outcome probabilities, competing event probabilities (if any), outcomes, and competing events (if any) based on an observed dataset and a userspecified intervention.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39  simulate(
o,
fitcov,
fitY,
fitD,
yrestrictions,
compevent_restrictions,
restrictions,
outcome_name,
compevent_name,
time_name,
intvars,
interventions,
int_times,
histvars,
histvals,
histories,
comprisk,
ranges,
yrange,
compevent_range,
outcome_type,
subseed,
obs_data,
time_points,
parallel,
covnames,
covtypes,
covparams,
covpredict_custom,
basecovs,
max_visits,
baselags,
below_zero_indicator,
min_time,
show_progress,
pb,
...
)

o 
Integer specifying the index of the current intervention. 
fitcov 
List of model fits for the timevarying covariates. 
fitY 
Model fit for the outcome variable. 
fitD 
Model fit for the competing event variable, if any. 
yrestrictions 
List of vectors. Each vector containins as its first entry
a condition and its second entry an integer. When the
condition is 
compevent_restrictions 
List of vectors. Each vector containins as its first entry
a condition and its second entry an integer. When the
condition is 
restrictions 
List of vectors. Each vector contains as its first entry a covariate for which
a priori knowledge of its distribution is available; its second entry a condition
under which no knowledge of its distribution is available and that must be 
outcome_name 
Character string specifying the name of the outcome variable in 
compevent_name 
Character string specifying the name of the competing event variable in 
time_name 
Character string specifying the name of the time variable in 
intvars 
List, whose elements are vectors of character strings. The kth vector in 
interventions 
List, whose elements are lists of vectors. Each list in 
int_times 
List, whose elements are lists of vectors. The kth list in 
histvars 
List of vectors. The kth vector specifies the names of the variables for which the kth history function
in 
histvals 
List of length two. The first element is a numeric vector specifying the lags used in the model statements (e.g., if 
histories 
Vector of history functions to apply to the variables specified in 
comprisk 
Logical scalar indicating the presence of a competing event. 
ranges 
List of vectors. Each vector contains the minimum and
maximum values of one of the covariates in 
yrange 
Vector containing the minimum and maximum values of the outcome variable in the observed dataset. 
compevent_range 
Vector containing the minimum and maximum values of the competing event variable in the observed dataset. 
outcome_type 
Character string specifying the "type" of the outcome. The possible "types" are: 
subseed 
Integer specifying the seed for this simulation. 
obs_data 
Data table containing the observed data. 
time_points 
Number of time points to simulate. 
parallel 
Logical scalar indicating whether to parallelize simulations of different interventions to multiple cores. 
covnames 
Character string specifying the name of the competing event variable in 
covtypes 
Vector of character strings specifying the "type" of each timevarying covariate included in 
covparams 
List of vectors, where each vector contains information for
one parameter used in the modeling of the timevarying covariates (e.g.,
model statement, family, link function, etc.). Each vector
must be the same length as 
covpredict_custom 
Vector containing custom prediction functions for timevarying
covariates that do not fall within the predefined covariate types.
It should be in the same order as 
basecovs 
Vector of character strings specifying the names of baseline covariates in 
max_visits 
A vector of one or more values denoting the maximum number of times a binary covariate representing a visit process may be missed before the individual is censored from the data (in the observed data) or a visit is forced (in the simulated data). Multiple values exist in the vector when the modeling of more than covariate is attached to a visit process. 
baselags 
Logical scalar for specifying the convention used for lagi and lag_cumavgi terms in the model statements when prebaseline times are not
included in 
below_zero_indicator 
Logical scalar indicating whether the observed data set contains rows for time t < 0. 
min_time 
Numeric scalar specifying lowest value of time t in the observed data set. 
show_progress 
Logical scalar indicating whether to print a progress bar for the number of bootstrap samples completed in the R console. This argument is only applicable when 
pb 
Progress bar R6 object. See 
... 
Other arguments, which are passed to the functions in 
A data table containing simulated data under the specified intervention.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.