This function creates a data set with a single simulated oncology clinical trial with one row per transition based on an illness-death model. Studies with an arbitrary number of treatment arms are possible.

getOneClinicalTrial(
  nPat,
  transitionByArm,
  dropout = list(rate = 0, time = 12),
  accrual = list(param = "time", value = 0)
)

Arguments

nPat

(integer)
numbers of patients per treatment arm.

transitionByArm

(list)
transition parameters for each treatment group. See exponential_transition(), piecewise_exponential() and weibull_transition() for details.

dropout

dropout (list)
specifies drop-out probability. See getSimulatedData() for details.

accrual

accrual (list)
specifies accrual intensity. See addStaggeredEntry() for details.

Value

This returns a data frame with one simulated clinical trial and multiple treatment arms. See getSimulatedData() for the explanation of the columns. The column trt contains the treatment indicator. This is a helper function of getClinicalTrials().

Examples

transition1 <- exponential_transition(h01 = 1.2, h02 = 1.5, h12 = 1.6)
transition2 <- exponential_transition(h01 = 1, h02 = 1.3, h12 = 1.7)
transition3 <- exponential_transition(h01 = 1.1, h02 = 1, h12 = 1.5)
getOneClinicalTrial(
  nPat = c(30, 20, 30), transitionByArm = list(transition1, transition2, transition3),
  dropout = list(rate = 0, time = 12),
  accrual = list(param = "time", value = 0)
)
#>     id from to       entry        exit    entryAct     exitAct censAct trt
#> 1    1    0  1 0.000000000 0.148022934 0.000000000 0.148022934     Inf   1
#> 2    1    1  2 0.148022934 1.333998383 0.148022934 1.333998383     Inf   1
#> 3    2    0  1 0.000000000 0.209486852 0.000000000 0.209486852     Inf   1
#> 4    2    1  2 0.209486852 0.360519213 0.209486852 0.360519213     Inf   1
#> 5    3    0  2 0.000000000 0.015768900 0.000000000 0.015768900     Inf   1
#> 6    4    0  1 0.000000000 0.506287506 0.000000000 0.506287506     Inf   1
#> 7    4    1  2 0.506287506 0.680540891 0.506287506 0.680540891     Inf   1
#> 8    5    0  2 0.000000000 0.629989023 0.000000000 0.629989023     Inf   1
#> 9    6    0  2 0.000000000 0.070282816 0.000000000 0.070282816     Inf   1
#> 10   7    0  2 0.000000000 0.082747110 0.000000000 0.082747110     Inf   1
#> 11   8    0  2 0.000000000 0.105141789 0.000000000 0.105141789     Inf   1
#> 12   9    0  1 0.000000000 0.389225836 0.000000000 0.389225836     Inf   1
#> 13   9    1  2 0.389225836 0.631348129 0.389225836 0.631348129     Inf   1
#> 14  10    0  1 0.000000000 0.580319351 0.000000000 0.580319351     Inf   1
#> 15  10    1  2 0.580319351 1.087102045 0.580319351 1.087102045     Inf   1
#> 16  11    0  1 0.000000000 0.399545952 0.000000000 0.399545952     Inf   1
#> 17  11    1  2 0.399545952 1.003346889 0.399545952 1.003346889     Inf   1
#> 18  12    0  2 0.000000000 0.662607743 0.000000000 0.662607743     Inf   1
#> 19  13    0  1 0.000000000 1.017544441 0.000000000 1.017544441     Inf   1
#> 20  13    1  2 1.017544441 2.605636085 1.017544441 2.605636085     Inf   1
#> 21  14    0  2 0.000000000 0.111087196 0.000000000 0.111087196     Inf   1
#> 22  15    0  2 0.000000000 0.319463058 0.000000000 0.319463058     Inf   1
#> 23  16    0  1 0.000000000 0.786816953 0.000000000 0.786816953     Inf   1
#> 24  16    1  2 0.786816953 1.521027363 0.786816953 1.521027363     Inf   1
#> 25  17    0  1 0.000000000 0.509273180 0.000000000 0.509273180     Inf   1
#> 26  17    1  2 0.509273180 1.833865772 0.509273180 1.833865772     Inf   1
#> 27  18    0  2 0.000000000 0.110217482 0.000000000 0.110217482     Inf   1
#> 28  19    0  2 0.000000000 0.764226012 0.000000000 0.764226012     Inf   1
#> 29  20    0  2 0.000000000 0.504216117 0.000000000 0.504216117     Inf   1
#> 30  21    0  2 0.000000000 0.155148858 0.000000000 0.155148858     Inf   1
#> 31  22    0  1 0.000000000 0.224500273 0.000000000 0.224500273     Inf   1
#> 32  22    1  2 0.224500273 0.704834333 0.224500273 0.704834333     Inf   1
#> 33  23    0  1 0.000000000 0.018570994 0.000000000 0.018570994     Inf   1
#> 34  23    1  2 0.018570994 0.054925605 0.018570994 0.054925605     Inf   1
#> 35  24    0  1 0.000000000 0.517033473 0.000000000 0.517033473     Inf   1
#> 36  24    1  2 0.517033473 0.694284429 0.517033473 0.694284429     Inf   1
#> 37  25    0  2 0.000000000 0.301405817 0.000000000 0.301405817     Inf   1
#> 38  26    0  2 0.000000000 0.389061295 0.000000000 0.389061295     Inf   1
#> 39  27    0  1 0.000000000 0.881948118 0.000000000 0.881948118     Inf   1
#> 40  27    1  2 0.881948118 1.982239477 0.881948118 1.982239477     Inf   1
#> 41  28    0  2 0.000000000 1.180287762 0.000000000 1.180287762     Inf   1
#> 42  29    0  1 0.000000000 0.030809960 0.000000000 0.030809960     Inf   1
#> 43  29    1  2 0.030809960 3.656823105 0.030809960 3.656823105     Inf   1
#> 44  30    0  2 0.000000000 0.280155202 0.000000000 0.280155202     Inf   1
#> 45  31    0  2 0.000000000 0.198637324 0.000000000 0.198637324     Inf   2
#> 46  32    0  2 0.000000000 0.211672056 0.000000000 0.211672056     Inf   2
#> 47  33    0  1 0.000000000 0.134375833 0.000000000 0.134375833     Inf   2
#> 48  33    1  2 0.134375833 1.429174705 0.134375833 1.429174705     Inf   2
#> 49  34    0  2 0.000000000 0.285518514 0.000000000 0.285518514     Inf   2
#> 50  35    0  1 0.000000000 0.063257958 0.000000000 0.063257958     Inf   2
#> 51  35    1  2 0.063257958 0.103876671 0.063257958 0.103876671     Inf   2
#> 52  36    0  2 0.000000000 1.835814756 0.000000000 1.835814756     Inf   2
#> 53  37    0  1 0.000000000 0.206160463 0.000000000 0.206160463     Inf   2
#> 54  37    1  2 0.206160463 0.210416211 0.206160463 0.210416211     Inf   2
#> 55  38    0  2 0.000000000 1.278530643 0.000000000 1.278530643     Inf   2
#> 56  39    0  1 0.000000000 0.610599127 0.000000000 0.610599127     Inf   2
#> 57  39    1  2 0.610599127 0.664125939 0.610599127 0.664125939     Inf   2
#> 58  40    0  2 0.000000000 0.050719057 0.000000000 0.050719057     Inf   2
#> 59  41    0  2 0.000000000 1.122710967 0.000000000 1.122710967     Inf   2
#> 60  42    0  2 0.000000000 1.349863336 0.000000000 1.349863336     Inf   2
#> 61  43    0  2 0.000000000 0.352268028 0.000000000 0.352268028     Inf   2
#> 62  44    0  1 0.000000000 0.134767094 0.000000000 0.134767094     Inf   2
#> 63  44    1  2 0.134767094 1.014544121 0.134767094 1.014544121     Inf   2
#> 64  45    0  2 0.000000000 0.276758356 0.000000000 0.276758356     Inf   2
#> 65  46    0  1 0.000000000 0.039259413 0.000000000 0.039259413     Inf   2
#> 66  46    1  2 0.039259413 0.189337620 0.039259413 0.189337620     Inf   2
#> 67  47    0  2 0.000000000 0.236708277 0.000000000 0.236708277     Inf   2
#> 68  48    0  2 0.000000000 0.115775823 0.000000000 0.115775823     Inf   2
#> 69  49    0  2 0.000000000 0.770179214 0.000000000 0.770179214     Inf   2
#> 70  50    0  1 0.000000000 1.325192268 0.000000000 1.325192268     Inf   2
#> 71  50    1  2 1.325192268 1.645315584 1.325192268 1.645315584     Inf   2
#> 72  51    0  1 0.000000000 0.525947083 0.000000000 0.525947083     Inf   3
#> 73  51    1  2 0.525947083 0.598273885 0.525947083 0.598273885     Inf   3
#> 74  52    0  2 0.000000000 0.118868937 0.000000000 0.118868937     Inf   3
#> 75  53    0  2 0.000000000 0.012552279 0.000000000 0.012552279     Inf   3
#> 76  54    0  1 0.000000000 0.719614118 0.000000000 0.719614118     Inf   3
#> 77  54    1  2 0.719614118 2.454226029 0.719614118 2.454226029     Inf   3
#> 78  55    0  2 0.000000000 0.159367334 0.000000000 0.159367334     Inf   3
#> 79  56    0  2 0.000000000 0.644462194 0.000000000 0.644462194     Inf   3
#> 80  57    0  2 0.000000000 1.953800925 0.000000000 1.953800925     Inf   3
#> 81  58    0  2 0.000000000 0.368045876 0.000000000 0.368045876     Inf   3
#> 82  59    0  2 0.000000000 0.265631665 0.000000000 0.265631665     Inf   3
#> 83  60    0  2 0.000000000 0.093850242 0.000000000 0.093850242     Inf   3
#> 84  61    0  1 0.000000000 0.029088501 0.000000000 0.029088501     Inf   3
#> 85  61    1  2 0.029088501 1.904412262 0.029088501 1.904412262     Inf   3
#> 86  62    0  2 0.000000000 0.130965078 0.000000000 0.130965078     Inf   3
#> 87  63    0  1 0.000000000 0.480749729 0.000000000 0.480749729     Inf   3
#> 88  63    1  2 0.480749729 1.341041219 0.480749729 1.341041219     Inf   3
#> 89  64    0  2 0.000000000 0.025888217 0.000000000 0.025888217     Inf   3
#> 90  65    0  2 0.000000000 0.093122622 0.000000000 0.093122622     Inf   3
#> 91  66    0  2 0.000000000 1.669897838 0.000000000 1.669897838     Inf   3
#> 92  67    0  2 0.000000000 0.028917710 0.000000000 0.028917710     Inf   3
#> 93  68    0  1 0.000000000 0.274555866 0.000000000 0.274555866     Inf   3
#> 94  68    1  2 0.274555866 0.632094191 0.274555866 0.632094191     Inf   3
#> 95  69    0  1 0.000000000 0.975858364 0.000000000 0.975858364     Inf   3
#> 96  69    1  2 0.975858364 2.481567041 0.975858364 2.481567041     Inf   3
#> 97  70    0  1 0.000000000 0.121543429 0.000000000 0.121543429     Inf   3
#> 98  70    1  2 0.121543429 0.381798691 0.121543429 0.381798691     Inf   3
#> 99  71    0  1 0.000000000 0.752356562 0.000000000 0.752356562     Inf   3
#> 100 71    1  2 0.752356562 2.081325865 0.752356562 2.081325865     Inf   3
#> 101 72    0  1 0.000000000 0.007365966 0.000000000 0.007365966     Inf   3
#> 102 72    1  2 0.007365966 0.591014062 0.007365966 0.591014062     Inf   3
#> 103 73    0  2 0.000000000 1.083358976 0.000000000 1.083358976     Inf   3
#> 104 74    0  1 0.000000000 0.193407522 0.000000000 0.193407522     Inf   3
#> 105 74    1  2 0.193407522 0.410664046 0.193407522 0.410664046     Inf   3
#> 106 75    0  2 0.000000000 0.484782232 0.000000000 0.484782232     Inf   3
#> 107 76    0  2 0.000000000 0.164070060 0.000000000 0.164070060     Inf   3
#> 108 77    0  2 0.000000000 0.036236528 0.000000000 0.036236528     Inf   3
#> 109 78    0  2 0.000000000 0.039918033 0.000000000 0.039918033     Inf   3
#> 110 79    0  1 0.000000000 0.393167939 0.000000000 0.393167939     Inf   3
#> 111 79    1  2 0.393167939 1.076894314 0.393167939 1.076894314     Inf   3
#> 112 80    0  2 0.000000000 2.266786247 0.000000000 2.266786247     Inf   3