Skip to contents

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.

Usage

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. Can be specified either as one list that should be applied to all treatment groups or a separate list for each treatment group.

accrual

accrual (list)
specifies accrual intensity. See addStaggeredEntry() for details. Can be specified either as one list that should be applied to all treatment groups or a separate list for each treatment group.

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 1.041846534 0.000000000 1.041846534     Inf   1
#> 2    1    1  2 1.041846534 1.785545401 1.041846534 1.785545401     Inf   1
#> 3    2    0  2 0.000000000 0.477939717 0.000000000 0.477939717     Inf   1
#> 4    3    0  2 0.000000000 0.198632402 0.000000000 0.198632402     Inf   1
#> 5    4    0  1 0.000000000 0.836504820 0.000000000 0.836504820     Inf   1
#> 6    4    1  2 0.836504820 1.675281116 0.836504820 1.675281116     Inf   1
#> 7    5    0  1 0.000000000 0.144586256 0.000000000 0.144586256     Inf   1
#> 8    5    1  2 0.144586256 0.377156364 0.144586256 0.377156364     Inf   1
#> 9    6    0  2 0.000000000 0.738316279 0.000000000 0.738316279     Inf   1
#> 10   7    0  1 0.000000000 0.324248942 0.000000000 0.324248942     Inf   1
#> 11   7    1  2 0.324248942 0.584568619 0.324248942 0.584568619     Inf   1
#> 12   8    0  1 0.000000000 0.120698069 0.000000000 0.120698069     Inf   1
#> 13   8    1  2 0.120698069 0.239101297 0.120698069 0.239101297     Inf   1
#> 14   9    0  1 0.000000000 0.379847986 0.000000000 0.379847986     Inf   1
#> 15   9    1  2 0.379847986 2.304839337 0.379847986 2.304839337     Inf   1
#> 16  10    0  1 0.000000000 0.550436302 0.000000000 0.550436302     Inf   1
#> 17  10    1  2 0.550436302 0.954895366 0.550436302 0.954895366     Inf   1
#> 18  11    0  1 0.000000000 0.065405460 0.000000000 0.065405460     Inf   1
#> 19  11    1  2 0.065405460 0.432720658 0.065405460 0.432720658     Inf   1
#> 20  12    0  1 0.000000000 0.416168752 0.000000000 0.416168752     Inf   1
#> 21  12    1  2 0.416168752 0.425586299 0.416168752 0.425586299     Inf   1
#> 22  13    0  1 0.000000000 0.848635343 0.000000000 0.848635343     Inf   1
#> 23  13    1  2 0.848635343 1.345220684 0.848635343 1.345220684     Inf   1
#> 24  14    0  2 0.000000000 0.293636775 0.000000000 0.293636775     Inf   1
#> 25  15    0  1 0.000000000 0.190591749 0.000000000 0.190591749     Inf   1
#> 26  15    1  2 0.190591749 0.410027811 0.190591749 0.410027811     Inf   1
#> 27  16    0  2 0.000000000 0.074930422 0.000000000 0.074930422     Inf   1
#> 28  17    0  2 0.000000000 0.799729649 0.000000000 0.799729649     Inf   1
#> 29  18    0  1 0.000000000 0.473761520 0.000000000 0.473761520     Inf   1
#> 30  18    1  2 0.473761520 0.856473293 0.473761520 0.856473293     Inf   1
#> 31  19    0  2 0.000000000 0.623404745 0.000000000 0.623404745     Inf   1
#> 32  20    0  1 0.000000000 0.276036099 0.000000000 0.276036099     Inf   1
#> 33  20    1  2 0.276036099 0.378378385 0.276036099 0.378378385     Inf   1
#> 34  21    0  2 0.000000000 0.248112642 0.000000000 0.248112642     Inf   1
#> 35  22    0  2 0.000000000 0.166077237 0.000000000 0.166077237     Inf   1
#> 36  23    0  2 0.000000000 0.119202878 0.000000000 0.119202878     Inf   1
#> 37  24    0  1 0.000000000 0.638967936 0.000000000 0.638967936     Inf   1
#> 38  24    1  2 0.638967936 1.648969622 0.638967936 1.648969622     Inf   1
#> 39  25    0  1 0.000000000 0.485001721 0.000000000 0.485001721     Inf   1
#> 40  25    1  2 0.485001721 1.425102016 0.485001721 1.425102016     Inf   1
#> 41  26    0  2 0.000000000 0.677533459 0.000000000 0.677533459     Inf   1
#> 42  27    0  2 0.000000000 0.424758013 0.000000000 0.424758013     Inf   1
#> 43  28    0  1 0.000000000 0.612796632 0.000000000 0.612796632     Inf   1
#> 44  28    1  2 0.612796632 0.768975224 0.612796632 0.768975224     Inf   1
#> 45  29    0  2 0.000000000 0.063063325 0.000000000 0.063063325     Inf   1
#> 46  30    0  1 0.000000000 0.001675383 0.000000000 0.001675383     Inf   1
#> 47  30    1  2 0.001675383 0.014149445 0.001675383 0.014149445     Inf   1
#> 48  31    0  2 0.000000000 0.376999758 0.000000000 0.376999758     Inf   2
#> 49  32    0  1 0.000000000 0.004662485 0.000000000 0.004662485     Inf   2
#> 50  32    1  2 0.004662485 2.686381115 0.004662485 2.686381115     Inf   2
#> 51  33    0  2 0.000000000 0.549150618 0.000000000 0.549150618     Inf   2
#> 52  34    0  2 0.000000000 0.252850824 0.000000000 0.252850824     Inf   2
#> 53  35    0  2 0.000000000 0.048971014 0.000000000 0.048971014     Inf   2
#> 54  36    0  2 0.000000000 1.190994143 0.000000000 1.190994143     Inf   2
#> 55  37    0  1 0.000000000 0.387723021 0.000000000 0.387723021     Inf   2
#> 56  37    1  2 0.387723021 1.677378489 0.387723021 1.677378489     Inf   2
#> 57  38    0  2 0.000000000 0.153998393 0.000000000 0.153998393     Inf   2
#> 58  39    0  2 0.000000000 0.140612650 0.000000000 0.140612650     Inf   2
#> 59  40    0  2 0.000000000 0.115334711 0.000000000 0.115334711     Inf   2
#> 60  41    0  2 0.000000000 1.117426714 0.000000000 1.117426714     Inf   2
#> 61  42    0  2 0.000000000 0.369076069 0.000000000 0.369076069     Inf   2
#> 62  43    0  1 0.000000000 0.619694733 0.000000000 0.619694733     Inf   2
#> 63  43    1  2 0.619694733 0.747321687 0.619694733 0.747321687     Inf   2
#> 64  44    0  2 0.000000000 0.069418866 0.000000000 0.069418866     Inf   2
#> 65  45    0  2 0.000000000 0.018769671 0.000000000 0.018769671     Inf   2
#> 66  46    0  2 0.000000000 0.180340436 0.000000000 0.180340436     Inf   2
#> 67  47    0  1 0.000000000 0.748051530 0.000000000 0.748051530     Inf   2
#> 68  47    1  2 0.748051530 0.826597896 0.748051530 0.826597896     Inf   2
#> 69  48    0  2 0.000000000 1.073077454 0.000000000 1.073077454     Inf   2
#> 70  49    0  2 0.000000000 0.383623952 0.000000000 0.383623952     Inf   2
#> 71  50    0  2 0.000000000 0.341823002 0.000000000 0.341823002     Inf   2
#> 72  51    0  2 0.000000000 1.324966440 0.000000000 1.324966440     Inf   3
#> 73  52    0  1 0.000000000 0.227653135 0.000000000 0.227653135     Inf   3
#> 74  52    1  2 0.227653135 0.640835097 0.227653135 0.640835097     Inf   3
#> 75  53    0  1 0.000000000 0.026038723 0.000000000 0.026038723     Inf   3
#> 76  53    1  2 0.026038723 0.636689636 0.026038723 0.636689636     Inf   3
#> 77  54    0  2 0.000000000 0.155402816 0.000000000 0.155402816     Inf   3
#> 78  55    0  1 0.000000000 0.072191253 0.000000000 0.072191253     Inf   3
#> 79  55    1  2 0.072191253 0.556745505 0.072191253 0.556745505     Inf   3
#> 80  56    0  1 0.000000000 0.727734457 0.000000000 0.727734457     Inf   3
#> 81  56    1  2 0.727734457 1.128613158 0.727734457 1.128613158     Inf   3
#> 82  57    0  2 0.000000000 0.096652997 0.000000000 0.096652997     Inf   3
#> 83  58    0  2 0.000000000 1.041313011 0.000000000 1.041313011     Inf   3
#> 84  59    0  1 0.000000000 0.031554070 0.000000000 0.031554070     Inf   3
#> 85  59    1  2 0.031554070 0.378476550 0.031554070 0.378476550     Inf   3
#> 86  60    0  2 0.000000000 1.049345811 0.000000000 1.049345811     Inf   3
#> 87  61    0  2 0.000000000 1.274462026 0.000000000 1.274462026     Inf   3
#> 88  62    0  1 0.000000000 0.262239182 0.000000000 0.262239182     Inf   3
#> 89  62    1  2 0.262239182 1.185368013 0.262239182 1.185368013     Inf   3
#> 90  63    0  2 0.000000000 0.901371136 0.000000000 0.901371136     Inf   3
#> 91  64    0  2 0.000000000 0.009099860 0.000000000 0.009099860     Inf   3
#> 92  65    0  2 0.000000000 1.173042134 0.000000000 1.173042134     Inf   3
#> 93  66    0  2 0.000000000 0.218041763 0.000000000 0.218041763     Inf   3
#> 94  67    0  2 0.000000000 0.150703354 0.000000000 0.150703354     Inf   3
#> 95  68    0  2 0.000000000 0.176833163 0.000000000 0.176833163     Inf   3
#> 96  69    0  2 0.000000000 0.363713581 0.000000000 0.363713581     Inf   3
#> 97  70    0  2 0.000000000 0.290230965 0.000000000 0.290230965     Inf   3
#> 98  71    0  2 0.000000000 0.965436826 0.000000000 0.965436826     Inf   3
#> 99  72    0  2 0.000000000 1.290563037 0.000000000 1.290563037     Inf   3
#> 100 73    0  1 0.000000000 0.921337732 0.000000000 0.921337732     Inf   3
#> 101 73    1  2 0.921337732 1.411323176 0.921337732 1.411323176     Inf   3
#> 102 74    0  1 0.000000000 0.370194057 0.000000000 0.370194057     Inf   3
#> 103 74    1  2 0.370194057 0.998483516 0.370194057 0.998483516     Inf   3
#> 104 75    0  2 0.000000000 0.593267184 0.000000000 0.593267184     Inf   3
#> 105 76    0  2 0.000000000 0.087529620 0.000000000 0.087529620     Inf   3
#> 106 77    0  2 0.000000000 0.394015487 0.000000000 0.394015487     Inf   3
#> 107 78    0  1 0.000000000 0.473727459 0.000000000 0.473727459     Inf   3
#> 108 78    1  2 0.473727459 0.489373740 0.473727459 0.489373740     Inf   3
#> 109 79    0  1 0.000000000 0.062052474 0.000000000 0.062052474     Inf   3
#> 110 79    1  2 0.062052474 0.130825736 0.062052474 0.130825736     Inf   3
#> 111 80    0  1 0.000000000 0.138737238 0.000000000 0.138737238     Inf   3
#> 112 80    1  2 0.138737238 0.811405377 0.138737238 0.811405377     Inf   3