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):

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.5524410 0.5300802 0.4884530 0.4644377 0.3257280 0.2146325 0.2199738
#>   [8] 0.3394785 0.4408745 0.3100837 0.4149734 0.4925527 0.4515616 0.5127535
#>  [15] 0.4483044 0.4592592 0.4353891 0.4564893 0.5271832 0.5383696 0.4770907
#>  [22] 0.5302606 0.4517698 0.3829257 0.2458602 0.3930905 0.4950581 0.5144050
#>  [29] 0.4917672 0.5455271 0.4328367 0.5852636 0.4622582 0.4279857 0.3191211
#>  [36] 0.2734536 0.3829172 0.1772183 0.1926786 0.3529108 0.4155486 0.3986605
#>  [43] 0.5470833 0.5070803 0.5161570 0.4272769 0.3873004 0.3583902 0.2985716
#>  [50] 0.2669691 0.3198527 0.4146064 0.4175811 0.4390131 0.4546382 0.4727111
#>  [57] 0.5506074 0.4981400 0.5885929 0.5284473 0.4550777 0.4862959 0.4644220
#>  [64] 0.3957314 0.4333597 0.4673849 0.4174853 0.4683068 0.4282711 0.3774254
#>  [71] 0.3643336 0.3555985 0.3947504 0.4382841 0.5313769 0.4265215 0.4894510
#>  [78] 0.5729996 0.5643039 0.6215406 0.5517417 0.4202179 0.4200778 0.4637510
#>  [85] 0.4659727 0.5054957 0.5909012 0.5051471 0.6175900 0.4833200 0.4803113
#>  [92] 0.4023958 0.4382736 0.4138599 0.4193131 0.4800092 0.3710054 0.3687845
#>  [99] 0.3656238 0.4090458 0.4060909 0.5052629 0.4538469 0.3676280 0.3492024
#> [106] 0.3061672 0.2960479 0.2599555 0.2824715 0.3944773 0.3370991 0.4139173
#> [113] 0.3663818 0.3853143 0.3675805 0.3790412 0.2584790 0.2335226 0.2351305
#> [120] 0.2034489 0.2272555 0.2249035 0.3617187 0.4227848 0.4042110 0.4228831
#> [127] 0.4024481 0.4050284 0.3770585 0.4437109 0.3266559 0.3072443 0.2609974
#> [134] 0.2653903 0.2893916 0.4612201 0.3986842 0.4472368 0.4543359 0.3406243
#> [141] 0.3461732 0.4175229 0.4594651 0.4120862 0.4741197 0.4869562 0.4560392
#> [148] 0.3555284 0.3280226 0.3225049 0.3623355 0.4152430 0.4201873 0.5454624
#> [155] 0.6198664 0.7135328 0.4975135 0.5912666 0.6285808 0.6522766 0.5000882
#> [162] 0.4908786 0.2888206 0.2628743 0.3115813 0.3545008 0.3133385 0.4125696
#> [169] 0.3855087 0.3415780 0.4230986 0.4553277 0.4837954 0.5567935 0.4043753
#> [176] 0.3293407 0.3110985 0.3499188 0.4521603 0.4283748 0.4112201 0.3978896
#> [183] 0.4271645 0.4461072 0.4740991 0.4017977 0.4314535 0.4823873 0.3818555
#> [190] 0.3412068 0.3460962 0.3835974 0.4948951 0.4133223 0.4159982 0.5668484
#> [197] 0.5342064 0.7057879 0.5547459 0.5838650 0.6103638 0.4894351 0.3871663
#> [204] 0.3748456 0.3783038 0.3927270 0.5313406 0.4216205 0.3647107 0.5072149
#> [211] 0.5295763 0.4325560 0.5042057 0.4727367 0.5221964 0.5323855 0.4377302
#> [218] 0.4188576 0.4177999 0.4445966 0.4510334 0.4107290 0.5478404 0.5102752
#> [225] 0.4686525 0.4649405 0.5032714 0.5506935 0.4071089 0.3720384 0.4148984
#> [232] 0.4522450 0.5385120 0.4188709 0.4012864 0.4069360 0.2818351 0.4468836
#> [239] 0.4367348 0.4356912 0.4415117 0.4514321 0.4243910 0.3267944 0.3951684
#> [246] 0.4083959 0.4276555 0.4170550 0.3675924 0.3658453 0.3349886 0.2333878
#> [253] 0.2283545 0.2429682 0.3828481 0.3827794 0.3550341 0.3991367 0.3289642
#> [260] 0.3546558 0.3212045 0.3708720 0.3586287 0.5141503 0.5532914 0.5824361
#> [267] 0.6362767 0.5887945 0.6610320 0.5827464 0.4929173 0.3662352 0.3109058
#> [274] 0.3322472 0.4184420 0.5064988 0.5423480 0.5709124 0.4977488 0.5394156
#> [281] 0.5287402 0.5011621 0.4694525 0.4851884 0.5090165 0.4543959 0.5007348
#> [288] 0.5579632 0.5043271 0.4505302 0.3558993 0.2982395 0.3241261 0.3879885
#> [295] 0.3648017 0.4040978 0.4254796 0.3900928 0.5224655 0.5118066 0.4750014
#> [302] 0.4736502 0.3390725 0.3399319 0.3642748 0.3787280 0.4228255 0.3989927
#> [309] 0.3702735 0.3417021 0.4031507 0.5131750 0.4381949 0.3662430 0.3000007
#> [316] 0.3631905 0.3138970 0.2983885 0.3238070 0.2835515 0.2579951 0.2835199
#> [323] 0.2747797 0.3474539 0.3859604 0.4256956 0.5430456 0.4455918 0.4190411
#> [330] 0.3747896 0.3987090 0.4558366 0.5023918 0.3991882 0.3860421 0.4425164
#> [337] 0.3194377 0.3417897 0.3654953 0.3089223 0.4783649 0.5031838 0.5375406
#> [344] 0.4361146 0.3506872 0.3291350 0.3294655 0.2738720 0.2573694 0.2523995
#> [351] 0.2930162 0.4095834 0.5585282 0.5790721 0.5588226 0.5331839 0.5214691
#> [358] 0.4950590 0.4603168 0.3865127 0.3583616 0.4832510 0.5190422 0.5132144
#> [365] 0.4884506 0.3727990 0.3554264 0.3520810 0.3709317 0.3389639 0.3182440
#> [372] 0.3025741 0.2314041 0.2864881 0.4405930 0.3963085 0.3566419 0.4873995
#> [379] 0.3452553 0.4239463 0.2501822 0.4219499 0.5202344 0.5242041 0.4736192
#> [386] 0.4410691 0.4988848 0.4937809 0.5915326 0.6873190 0.5951622 0.4512694
#> [393] 0.4224117 0.4734724 0.2930790 0.3697791 0.3549983 0.4676168 0.5095475
#> [400] 0.5040778 0.5252980 0.4944516 0.4725186 0.4321335 0.4613515 0.3506542
#> [407] 0.4537499 0.4068316 0.4209565 0.4381722 0.5264781 0.5879488 0.4588402
#> [414] 0.4732864 0.4939062 0.6173799 0.5286040 0.5548483 0.5788388 0.5232496
#> [421] 0.4584566 0.5125099 0.5588937 0.4808669 0.3551368 0.2869743 0.3386015
#> [428] 0.2557575 0.1861623 0.1857969 0.1949700 0.2111929 0.2865864 0.3171804
#> [435] 0.4638823 0.3938979 0.5661607 0.5834720 0.4697341 0.4505056 0.5514488
#> [442] 0.4688744 0.3646362 0.2815944 0.3189757 0.2726074 0.3582710 0.3559133
#> [449] 0.3873958 0.3878360 0.4884423 0.5106965 0.5530598 0.5740161 0.4928797
#> [456] 0.4229858 0.4970042 0.4610138 0.4752774 0.4159336 0.1782113 0.2212232
#> [463] 0.3455619 0.2812269 0.3031879 0.2468048 0.4746516 0.4606645 0.4849826
#> [470] 0.4028993 0.3957396 0.2147402 0.1873911 0.2994685 0.3258845 0.4464414
#> [477] 0.4424241 0.4583951 0.3688082 0.2862930 0.3521715 0.4081643 0.3733938
#> [484] 0.5216767 0.4963807 0.4846116 0.4877308 0.4688525 0.4490368 0.4010840
#> [491] 0.4331823 0.4078399 0.3562507 0.3354589 0.4287247 0.3967132 0.4279581
#> [498] 0.3592298 0.3338149 0.3853293