Skip to contents

[Experimental]

Usage

biomarker(xLevel, model, samples, ...)

# S4 method for class 'integer,DualEndpoint,Samples'
biomarker(xLevel, model, samples, ...)

Arguments

xLevel

(integer)
the levels for the doses the patients have been given w.r.t dose grid. See Data for more details.

model

(DualEndpoint)
the model.

samples

(Samples)
the samples of model's parameters that store the value of biomarker levels for all doses on the dose grid.

...

not used.

Value

The biomarker levels.

Details

This function simply returns a specific columns (with the indices equal to xLevel) of the biomarker samples matrix, which is included in the the samples object.

Functions

  • biomarker(xLevel = integer, model = DualEndpoint, samples = Samples): Extract biomarker values for a DualEndpoint model.

Examples

# Create the data.
my_data <- DataDual(
  x = c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10, 20, 20, 20, 40, 40, 40, 50, 50, 50),
  y = c(0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1),
  ID = 1:17,
  cohort = c(
    1L,
    2L,
    3L,
    4L,
    5L,
    6L,
    6L,
    6L,
    7L,
    7L,
    7L,
    8L,
    8L,
    8L,
    9L,
    9L,
    9L
  ),
  w = c(
    0.31,
    0.42,
    0.59,
    0.45,
    0.6,
    0.7,
    0.55,
    0.6,
    0.52,
    0.54,
    0.56,
    0.43,
    0.41,
    0.39,
    0.34,
    0.38,
    0.21
  ),
  doseGrid = c(0.1, 0.5, 1.5, 3, 6, seq(from = 10, to = 80, by = 2))
)

# Initialize the Dual-Endpoint model (in this case RW1).
my_model <- DualEndpointRW(
  mean = c(0, 1),
  cov = matrix(c(1, 0, 0, 1), nrow = 2),
  sigma2betaW = 0.01,
  sigma2W = c(a = 0.1, b = 0.1),
  rho = c(a = 1, b = 1),
  rw1 = TRUE
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(
  burnin = 100,
  step = 2,
  samples = 500
)
my_samples <- mcmc(my_data, my_model, my_options)

# Obtain the biomarker levels (samples) for the second dose from the dose grid,
# which is 0.5.
biomarker(
  xLevel = 2L,
  model = my_model,
  samples = my_samples
)
#>   [1] 0.3968745 0.3978674 0.4758664 0.4465525 0.4427784 0.3935537 0.4395913
#>   [8] 0.3998930 0.4043312 0.5047915 0.4525924 0.4178995 0.4323743 0.4879214
#>  [15] 0.3979774 0.4140727 0.3799341 0.4742331 0.4860964 0.5345989 0.4454292
#>  [22] 0.5429308 0.6107654 0.5338409 0.6319877 0.5595271 0.5056781 0.4626306
#>  [29] 0.4437594 0.4631115 0.3228398 0.4603289 0.4333471 0.4471445 0.4083701
#>  [36] 0.3721723 0.3658363 0.3486467 0.3260358 0.4316638 0.3729640 0.3791548
#>  [43] 0.5934665 0.5579989 0.4923705 0.4937296 0.3823202 0.4190248 0.4039660
#>  [50] 0.4357323 0.4262822 0.4897285 0.4421738 0.4532789 0.4425785 0.4551861
#>  [57] 0.4942614 0.5258786 0.5067018 0.4546595 0.4981222 0.4950965 0.5378606
#>  [64] 0.5516657 0.4456727 0.3048079 0.3177685 0.4207771 0.3634024 0.3899236
#>  [71] 0.3946956 0.4208770 0.4107373 0.3924049 0.4224616 0.4245775 0.4457906
#>  [78] 0.3968311 0.4940150 0.4987304 0.4871955 0.5991754 0.6566408 0.5136626
#>  [85] 0.4221237 0.5249801 0.4771612 0.5845965 0.6201522 0.6537002 0.5361316
#>  [92] 0.5581444 0.4958197 0.4043127 0.3830468 0.3534191 0.3703710 0.2425660
#>  [99] 0.3038924 0.3698413 0.3708903 0.3087307 0.3351178 0.2840785 0.2120267
#> [106] 0.2553385 0.4320381 0.3841811 0.3526405 0.3401115 0.3610450 0.2949665
#> [113] 0.2106185 0.2225071 0.2836109 0.2969842 0.3575562 0.4715249 0.4351832
#> [120] 0.4592810 0.5840689 0.5119341 0.5480352 0.4843204 0.4814945 0.4389861
#> [127] 0.4542540 0.4591368 0.4771296 0.4447882 0.6226378 0.5470817 0.3948744
#> [134] 0.3935113 0.4671940 0.4097754 0.4598203 0.3930705 0.4113442 0.3426966
#> [141] 0.4163376 0.3956757 0.3386055 0.3615218 0.3506855 0.3560479 0.3991967
#> [148] 0.4695995 0.4719116 0.4033989 0.3053204 0.3830219 0.3744462 0.3419858
#> [155] 0.3258414 0.3521169 0.3737765 0.3269728 0.3130563 0.3576739 0.4336056
#> [162] 0.4185820 0.3410715 0.3537971 0.3003825 0.3239582 0.4391354 0.3998756
#> [169] 0.4309218 0.4264622 0.4303521 0.3649111 0.3541537 0.3630384 0.4836579
#> [176] 0.4593303 0.5688952 0.5591111 0.5100147 0.3615552 0.3400964 0.3905712
#> [183] 0.4328951 0.4828289 0.5459593 0.5223809 0.4834848 0.4658017 0.4727671
#> [190] 0.4842935 0.4299597 0.4505805 0.4740143 0.4593049 0.4614302 0.4405345
#> [197] 0.4004754 0.3920006 0.5858863 0.5211719 0.5996161 0.4648850 0.5300929
#> [204] 0.4888243 0.4377092 0.4407283 0.4109736 0.4068903 0.3563414 0.3023538
#> [211] 0.4078731 0.4514835 0.6376618 0.4926842 0.4675128 0.4009922 0.2802418
#> [218] 0.2613618 0.2497768 0.2452068 0.2481267 0.3204108 0.3606399 0.4438664
#> [225] 0.4155592 0.5347451 0.4081874 0.4638927 0.4023521 0.3962797 0.3682033
#> [232] 0.3812018 0.4831553 0.4784730 0.4383074 0.2478554 0.1673227 0.1868912
#> [239] 0.1588302 0.2843488 0.3506546 0.2900469 0.4411914 0.4787694 0.4261325
#> [246] 0.4320192 0.3949961 0.4085618 0.5374149 0.4951948 0.5489522 0.4571506
#> [253] 0.4183022 0.3394923 0.2741594 0.4802996 0.4042535 0.4348871 0.4714483
#> [260] 0.4959194 0.5263542 0.4921334 0.6160327 0.5776857 0.6962482 0.5752114
#> [267] 0.5879623 0.4827783 0.3719761 0.3798326 0.4149427 0.4880109 0.4219687
#> [274] 0.2755642 0.3761965 0.5456828 0.5299143 0.4542565 0.3876723 0.4091872
#> [281] 0.4213518 0.3826305 0.4231856 0.5200752 0.4289361 0.4420477 0.4499600
#> [288] 0.6245458 0.5908529 0.5463812 0.5086647 0.3496306 0.5210726 0.4146410
#> [295] 0.4179764 0.3629815 0.4224662 0.5029679 0.4811609 0.3862558 0.4750901
#> [302] 0.4756527 0.4456059 0.3722194 0.3254666 0.3319655 0.3686946 0.3064107
#> [309] 0.4298617 0.4331056 0.5307859 0.4740953 0.4588685 0.4181919 0.4116198
#> [316] 0.4648016 0.4305294 0.4236410 0.3399930 0.2001245 0.3290712 0.3702743
#> [323] 0.4810454 0.2703771 0.4115900 0.4808312 0.4964861 0.4729082 0.3950869
#> [330] 0.4398966 0.3720294 0.4153496 0.3235704 0.2651957 0.3131607 0.2680472
#> [337] 0.2649878 0.2190789 0.3237140 0.3522490 0.2678369 0.3496112 0.4900437
#> [344] 0.3775023 0.2131600 0.3876311 0.4240081 0.3796855 0.3864586 0.4211285
#> [351] 0.4639467 0.4609160 0.4113254 0.5277918 0.4590597 0.4728326 0.6077810
#> [358] 0.5149500 0.4778012 0.4782426 0.4361851 0.3390599 0.3057145 0.3065152
#> [365] 0.3347308 0.3704118 0.3070428 0.3639921 0.3376621 0.3817237 0.3522202
#> [372] 0.3941846 0.4157984 0.4657584 0.4983852 0.4354072 0.4966899 0.4692613
#> [379] 0.4910828 0.3570032 0.3744969 0.3604683 0.3135024 0.3311205 0.2845254
#> [386] 0.2596671 0.4288146 0.4049903 0.4613467 0.5238024 0.5695728 0.5385837
#> [393] 0.5092096 0.5711023 0.4979993 0.4953633 0.4496588 0.4792996 0.4463008
#> [400] 0.5623882 0.5169440 0.4805319 0.4732808 0.3623341 0.5016094 0.3692690
#> [407] 0.3485866 0.2958578 0.4017098 0.3929662 0.3836061 0.3272942 0.2395903
#> [414] 0.3228019 0.4115610 0.4403202 0.5298072 0.3932558 0.3586243 0.4198353
#> [421] 0.4577950 0.4941846 0.4536644 0.3400664 0.3857999 0.4150250 0.4779795
#> [428] 0.4236845 0.4425646 0.4557614 0.5442259 0.5949124 0.5491302 0.5782757
#> [435] 0.4681751 0.4693473 0.4252452 0.5086415 0.5304733 0.4896351 0.4331874
#> [442] 0.5148080 0.4326986 0.2796313 0.4106877 0.4367457 0.4644792 0.4939443
#> [449] 0.6297831 0.4964021 0.5161940 0.5620423 0.5921962 0.5731079 0.5854048
#> [456] 0.4492857 0.3410003 0.3841508 0.3750577 0.3463035 0.4725690 0.4275060
#> [463] 0.4175159 0.3818781 0.3287296 0.3668789 0.4235256 0.4683629 0.4859575
#> [470] 0.4555682 0.5092759 0.4170683 0.4926903 0.4183822 0.3968471 0.3176979
#> [477] 0.3950748 0.3587606 0.4132149 0.5349582 0.5617358 0.4887649 0.4396623
#> [484] 0.3852305 0.3648549 0.4227571 0.4304350 0.4230959 0.5412890 0.5355321
#> [491] 0.5721488 0.4984317 0.4623096 0.3992765 0.3553847 0.4373208 0.4008759
#> [498] 0.3760831 0.2925349 0.3874059