Skip to contents

Generate Data for a BaselineObject

Usage

# S4 method for class 'BaselineObject'
generate(x, ...)

Arguments

x

a BaselineObject object created by create_baseline_object

...

additional parameters are ignored

Value

A BaselineDataFrame object

Examples

bl_biomarkers <- create_baseline_object(
  n_trt_int = 100,
  n_ctrl_int = 50,
  n_ctrl_ext = 100,
  covariates = baseline_covariates(
    c("b1", "b2", "b3"),
    means_int = c(0, 0, 0),
    covariance_int = covariance_matrix(c(1, 1, 1), c(.8, .3, .8))
  ),
  transformations = list(
    exp_b1 = function(data) exp(data$b1),
    b2 = binary_cutoff("b2", int_cutoff = 0.7, ext_cutoff = 0.5)
  )
)
generate(bl_biomarkers)
#> Baseline Data List
#> 
#> Internal Treated
#>  patid ext trt          b1 b2           b3    exp_b1
#>      1   0   1 -0.29752164  0  0.651621455 0.7426565
#>      2   0   1 -0.09594731  0 -0.419500737 0.9085119
#>      3   0   1  0.68431145  0 -0.442280771 1.9824064
#>      4   0   1 -0.03911672  0  0.006301904 0.9616385
#>      5   0   1 -0.18551572  0 -0.173197245 0.8306758
#>      6   0   1 -1.17177372  0  0.449762281 0.3098169
#> Internal Control
#>  patid ext trt          b1 b2          b3    exp_b1
#>    101   0   0 -0.71772681  0 -0.01722127 0.4878600
#>    102   0   0  0.37417996  0  0.09695297 1.4537987
#>    103   0   0  0.02700627  1  1.50617783 1.0273742
#>    104   0   0 -0.01032250  0 -0.22911050 0.9897306
#>    105   0   0 -0.21465875  0 -0.78306875 0.8068167
#>    106   0   0 -1.75017156  0 -0.13664082 0.1737441
#> External Control
#>  patid ext trt          b1 b2          b3    exp_b1
#>    151   1   0  0.64842337  1  0.09323614 1.9125231
#>    152   1   0 -2.37665798  0  0.75488170 0.0928604
#>    153   1   0 -0.06731617  1  1.64724350 0.9348996
#>    154   1   0  1.25037819  1 -0.18215258 3.4916632
#>    155   1   0 -0.70986133  1  0.80879110 0.4917124
#>    156   1   0  1.67156477  1  1.42309757 5.3204866