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.3521571 0.4529277 0.4085671 0.4639434 0.3531925 0.3611460 0.4470745
#>   [8] 0.3556491 0.3821677 0.4050411 0.3381349 0.3355438 0.3700510 0.3298335
#>  [15] 0.3515523 0.5269784 0.5966903 0.5180684 0.4465868 0.4945991 0.4147574
#>  [22] 0.4327262 0.3631396 0.3952423 0.2377245 0.3121446 0.3378878 0.4197201
#>  [29] 0.3957447 0.4105525 0.4420920 0.3851753 0.3508990 0.4550262 0.4270893
#>  [36] 0.3295598 0.3063143 0.3750914 0.3860814 0.4844259 0.4196204 0.4295853
#>  [43] 0.5524133 0.5774736 0.5979008 0.6002246 0.5633436 0.6606717 0.5769804
#>  [50] 0.6477359 0.6090636 0.5144036 0.5199411 0.5171741 0.5949034 0.5412112
#>  [57] 0.5422264 0.4863917 0.4667402 0.3671313 0.2039280 0.2770401 0.3417221
#>  [64] 0.3192003 0.3031983 0.3723807 0.3373491 0.3154432 0.3424396 0.3742035
#>  [71] 0.3473483 0.4218692 0.4088841 0.3907769 0.3787695 0.4435458 0.3981367
#>  [78] 0.3318608 0.4243680 0.4139510 0.4290811 0.4673454 0.4645000 0.4416086
#>  [85] 0.4085218 0.3855030 0.4398296 0.3442052 0.3369888 0.3748656 0.3331222
#>  [92] 0.3052873 0.3917772 0.3244627 0.4060986 0.4716343 0.4830014 0.4212592
#>  [99] 0.2316044 0.2689785 0.3394078 0.3562205 0.4461154 0.4417418 0.4131800
#> [106] 0.5378951 0.4966024 0.4988459 0.5255558 0.4161853 0.4309002 0.5101206
#> [113] 0.4547049 0.4822026 0.4200713 0.4337832 0.2656811 0.2556454 0.3500620
#> [120] 0.3411486 0.3382926 0.3692064 0.3337245 0.3628782 0.2746492 0.2422522
#> [127] 0.4776395 0.4769788 0.4240744 0.4216463 0.3626319 0.4322736 0.2992965
#> [134] 0.3430729 0.3445017 0.3530408 0.4038544 0.4085105 0.2948663 0.3978263
#> [141] 0.3928819 0.3936594 0.2953256 0.3899408 0.4576264 0.4246580 0.4712050
#> [148] 0.4129303 0.4312141 0.4489859 0.4163888 0.5167373 0.5027209 0.5352688
#> [155] 0.4973866 0.4799582 0.6129182 0.4528073 0.5415206 0.3586774 0.5187318
#> [162] 0.4670545 0.5458635 0.4621427 0.4869268 0.3500478 0.4339207 0.3390324
#> [169] 0.4146453 0.3959473 0.4357409 0.4544476 0.4314719 0.5250996 0.5300098
#> [176] 0.5756770 0.5757444 0.5119005 0.5533526 0.4022735 0.3145478 0.2139425
#> [183] 0.3717768 0.3654202 0.2830360 0.3312358 0.3872846 0.3957167 0.4490015
#> [190] 0.4243128 0.4175681 0.3748006 0.3262278 0.3921491 0.3943761 0.4139212
#> [197] 0.4118246 0.3306912 0.4217280 0.4118298 0.3759874 0.5013662 0.4387061
#> [204] 0.3980641 0.3823222 0.3858035 0.3211521 0.3237688 0.3897534 0.3717865
#> [211] 0.3533580 0.3884351 0.3193494 0.2616702 0.2709509 0.2716096 0.3281908
#> [218] 0.3526683 0.4066382 0.2940310 0.3910269 0.3915556 0.4092589 0.5595713
#> [225] 0.6155553 0.4287384 0.3699834 0.4075459 0.4466849 0.4456447 0.4934975
#> [232] 0.4035857 0.3981510 0.3284136 0.2904196 0.3845042 0.4172975 0.4463223
#> [239] 0.3585362 0.3453514 0.3563700 0.2846579 0.3657303 0.3519639 0.4005437
#> [246] 0.4361700 0.4532328 0.4776443 0.4692119 0.4768870 0.4652294 0.4604194
#> [253] 0.4281921 0.4734916 0.4923395 0.5034627 0.5037013 0.4975610 0.5367447
#> [260] 0.3488399 0.4052929 0.4758448 0.5076876 0.4514649 0.5340970 0.4477537
#> [267] 0.4171665 0.3732321 0.5872152 0.4084733 0.3952840 0.4119427 0.4864658
#> [274] 0.5814638 0.5273088 0.5214001 0.6035825 0.7898352 0.4956443 0.5082400
#> [281] 0.5034667 0.4626025 0.6277309 0.6476634 0.5462890 0.5019358 0.4845475
#> [288] 0.4742577 0.4408767 0.6189478 0.5670089 0.5655896 0.4384683 0.4557341
#> [295] 0.6243831 0.5207020 0.4591702 0.5962364 0.5745336 0.6168670 0.6376256
#> [302] 0.6507732 0.5511229 0.5926388 0.4396140 0.4775907 0.4240586 0.4936319
#> [309] 0.4197802 0.3754320 0.3420541 0.2352693 0.2064323 0.1441818 0.2563760
#> [316] 0.4262200 0.4908794 0.3560014 0.4520132 0.4435053 0.4587690 0.5900791
#> [323] 0.5554255 0.4615324 0.5128373 0.4393954 0.4344384 0.4144762 0.3690790
#> [330] 0.3910660 0.4863974 0.4808183 0.4620422 0.5582683 0.4762412 0.5955417
#> [337] 0.4746513 0.4436185 0.4006938 0.4086917 0.4600018 0.5068182 0.3521324
#> [344] 0.2883967 0.4198217 0.3195448 0.4236478 0.2640617 0.3005538 0.5098127
#> [351] 0.5466138 0.5005972 0.4607326 0.4832828 0.4504776 0.5061345 0.4839466
#> [358] 0.5191381 0.4711569 0.3568904 0.3658244 0.3090458 0.3199803 0.2264130
#> [365] 0.4129936 0.3904867 0.3884861 0.3599341 0.4824441 0.5245456 0.4759133
#> [372] 0.5318186 0.5306695 0.6208491 0.4878415 0.4366984 0.4665459 0.6604871
#> [379] 0.6020610 0.5408723 0.5028573 0.4497095 0.3863632 0.4547784 0.2935082
#> [386] 0.2080459 0.1462422 0.2372198 0.2069481 0.2538390 0.3661273 0.4011176
#> [393] 0.4489872 0.3578314 0.4498354 0.3913989 0.3741952 0.4986180 0.4524244
#> [400] 0.5237091 0.4512465 0.3673564 0.4028013 0.4398760 0.3632988 0.4869732
#> [407] 0.4498521 0.3773884 0.4464132 0.4813998 0.6024706 0.6351952 0.5200352
#> [414] 0.3880148 0.3812748 0.4228936 0.4574685 0.4647323 0.4731527 0.3873127
#> [421] 0.3597683 0.3558385 0.3273906 0.2328408 0.2752231 0.3443275 0.5353015
#> [428] 0.5550473 0.5876334 0.4928933 0.3696481 0.4958348 0.3683994 0.2999193
#> [435] 0.2254472 0.3069837 0.3722223 0.3685229 0.3349727 0.3252566 0.3647649
#> [442] 0.5003403 0.5108432 0.5441427 0.4774333 0.4344183 0.3473708 0.2794613
#> [449] 0.2959372 0.3369800 0.3108661 0.4295916 0.4258077 0.4957200 0.5237083
#> [456] 0.5274518 0.5538419 0.4879656 0.4433363 0.2965546 0.2955005 0.3404825
#> [463] 0.3542263 0.3637697 0.3314929 0.4599545 0.5434028 0.4316936 0.5120336
#> [470] 0.6013790 0.5673927 0.5496381 0.4326192 0.3740906 0.3549561 0.6045213
#> [477] 0.5427702 0.5527532 0.4465912 0.3051526 0.2960806 0.4025476 0.5348235
#> [484] 0.4833502 0.4596330 0.4079414 0.4401004 0.3581863 0.2614556 0.4415462
#> [491] 0.4748982 0.4498043 0.5289782 0.5320994 0.4891525 0.3821367 0.5988202
#> [498] 0.4484686 0.5026956 0.3979757