Learn R Programming

QTOCen (version 0.1.1)

simJLSDdata: Function to generate simulation data from a sequentially randomized experiment designed in jiang2017estimationQTOCen

Description

Function to generate simulation data from a sequentially randomized experiment designed in jiang2017estimationQTOCen

Usage

simJLSDdata(n, case = "a", s_Diff_Time = 1, C_max = 5,
  Censored = TRUE, fix_x0_value = NULL)

Arguments

n

sample size

case

string. One of "a", "b", "c", corresponding to three models.

s_Diff_Time

Numeric. Default is 1. This is the length of time between two stages of treatment

C_max

Numeric. Default is 5. This the upper bound of the uniform distribution of the censoring time variable. Changing this value shifts the overall censoring rate easily.

Censored

Boolean. Default is TRUE. Whether the data has censoring or not. If TRUE, all survival time would not be censored at all in the returned data.

fix_x0_value

Numeric. Default is Null. If supplied, it will generate simulated data with a fixed value, fix_x0_value, of the univariate baseline covarate.

Value

This function returns a data.frame with simulated subject trajectories.

  • x0 the baseline covariate, always observable at relative time point 0;

  • a0 the observed first-stage treatment level at relative time point 0;

  • x1 an updated covariate observable to the relative time point s_Diff_Time, when the a second stage treatment is scheduled

  • a1 the observed second-stage treatment level at relative time point s_Diff_Time.

Details

This generative model is proposed in jiang2017estimationQTOCen, Section 5, the second example. It uniformly defined three sets of conditional distributions of the survival times given the observable covariates at each stage within the same framework.

All three models satisfy the independent censoring assumption.

References

jiang2017estimationQTOCen

Examples

Run this code
# NOT RUN {
dataA <- simJLSDdata(500,case="a")
dataB <- simJLSDdata(500,case="b")
dataC <- simJLSDdata(500,case="c")

# }

Run the code above in your browser using DataLab