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.4448473 0.3858319 0.4457279 0.4702368 0.5177436 0.4627731 0.6356766
#>   [8] 0.6121842 0.3909014 0.3714677 0.4348064 0.5024802 0.4667595 0.6148046
#>  [15] 0.6006391 0.7397418 0.5385204 0.5621475 0.5842666 0.5771075 0.5328806
#>  [22] 0.3765362 0.4067945 0.4461914 0.3426293 0.3720674 0.4312740 0.4868179
#>  [29] 0.3730997 0.3482410 0.3165415 0.3956972 0.4651576 0.4884907 0.5339622
#>  [36] 0.5470337 0.4972959 0.5327587 0.5021290 0.3525224 0.3551775 0.4239630
#>  [43] 0.3368338 0.3799484 0.4093494 0.4548648 0.5136451 0.5084419 0.5132128
#>  [50] 0.5618792 0.5774118 0.5738070 0.4614259 0.4584206 0.6135252 0.6064507
#>  [57] 0.5125226 0.5623915 0.5117464 0.5621011 0.4475147 0.4975484 0.3708824
#>  [64] 0.1890099 0.3438023 0.3677415 0.4109101 0.4374738 0.5240303 0.5260298
#>  [71] 0.5600372 0.5629759 0.5219012 0.4624570 0.3237937 0.3952626 0.4036902
#>  [78] 0.4677490 0.3253673 0.2945422 0.2660924 0.3120585 0.2742532 0.4012495
#>  [85] 0.4025405 0.5217393 0.5298860 0.4969447 0.3224434 0.3916342 0.3792696
#>  [92] 0.3476979 0.3642724 0.5181115 0.4237315 0.3331410 0.5175909 0.5147342
#>  [99] 0.5247418 0.4550314 0.3523745 0.3683197 0.4235128 0.4167245 0.4131407
#> [106] 0.4575888 0.5220394 0.5640531 0.5024077 0.5803443 0.5156549 0.4460025
#> [113] 0.3396136 0.4245770 0.4805678 0.5530584 0.3601831 0.4247929 0.5451869
#> [120] 0.5291317 0.5893309 0.5964157 0.5402106 0.5309342 0.5558956 0.5885116
#> [127] 0.5992596 0.4549684 0.5108166 0.7004600 0.6660679 0.5744284 0.4060511
#> [134] 0.3565254 0.2996419 0.2732518 0.3125188 0.2353713 0.2959576 0.3748386
#> [141] 0.5284683 0.4823067 0.4267162 0.2829007 0.3814354 0.4307232 0.4156791
#> [148] 0.3751961 0.3778014 0.4494675 0.4936819 0.3450934 0.3807014 0.3566324
#> [155] 0.3267155 0.3343032 0.2721264 0.4370589 0.3118160 0.4981051 0.4894017
#> [162] 0.4970545 0.6291432 0.6125365 0.5262940 0.5411952 0.4421885 0.3660842
#> [169] 0.4544909 0.4011364 0.4934109 0.4735181 0.4851454 0.5506632 0.4641567
#> [176] 0.4869295 0.4329952 0.5547336 0.5283916 0.3739194 0.3932625 0.4356983
#> [183] 0.3816355 0.4596653 0.2769691 0.3442556 0.4515503 0.4481479 0.5090837
#> [190] 0.5020357 0.4709501 0.4271444 0.3602720 0.3034004 0.3950298 0.3720503
#> [197] 0.5093633 0.4689346 0.4626689 0.5378295 0.4570341 0.5271457 0.6335631
#> [204] 0.6652867 0.5828483 0.5251327 0.5215950 0.4859247 0.4920485 0.4820754
#> [211] 0.5693712 0.6197062 0.5348659 0.5061134 0.4342363 0.4742159 0.5171350
#> [218] 0.4614054 0.3856793 0.4319118 0.4429283 0.4385645 0.4138605 0.3905249
#> [225] 0.3538404 0.3624128 0.3663801 0.4005784 0.4008861 0.4031781 0.4221733
#> [232] 0.3905563 0.4402989 0.5756724 0.5902197 0.3701470 0.3856031 0.3645437
#> [239] 0.4587484 0.3085309 0.3802215 0.3881112 0.3498091 0.3733818 0.3202914
#> [246] 0.4522427 0.5322391 0.4938531 0.4911339 0.5103086 0.5959047 0.6172278
#> [253] 0.5858654 0.5274383 0.5998116 0.6266202 0.4974438 0.3438968 0.4210895
#> [260] 0.3498668 0.3895172 0.3636147 0.3739502 0.4241628 0.3851185 0.3626139
#> [267] 0.3495039 0.3528009 0.3291079 0.4209799 0.3671191 0.3805510 0.3788693
#> [274] 0.4497269 0.4899261 0.4180342 0.4820784 0.4872879 0.4757790 0.3406497
#> [281] 0.3050956 0.3741378 0.4962732 0.5465296 0.4916954 0.4763559 0.3987296
#> [288] 0.4429038 0.4761661 0.4493393 0.4905475 0.4527164 0.4819891 0.5820887
#> [295] 0.6227014 0.5173481 0.5361676 0.4900108 0.5063391 0.5460928 0.6009320
#> [302] 0.5607918 0.4697432 0.4457927 0.4032832 0.3896200 0.3818751 0.4165230
#> [309] 0.4510609 0.3670753 0.3939773 0.4671173 0.4779094 0.4894913 0.5155002
#> [316] 0.5124916 0.3756355 0.5199545 0.4816445 0.4360566 0.3618024 0.2123371
#> [323] 0.3396616 0.3626589 0.4223006 0.4009895 0.3682212 0.3951189 0.3801246
#> [330] 0.3486966 0.3002538 0.3321836 0.3529898 0.3782175 0.3550481 0.3654583
#> [337] 0.3373533 0.3136448 0.3459503 0.3471626 0.3002758 0.4137515 0.3878922
#> [344] 0.4059872 0.3452070 0.3356211 0.4558014 0.3850213 0.3674708 0.4316140
#> [351] 0.4079806 0.4359369 0.5082487 0.5148789 0.4498450 0.4415406 0.4235482
#> [358] 0.4012702 0.4127689 0.3722265 0.4248322 0.4061782 0.4166721 0.3810363
#> [365] 0.3632782 0.3453111 0.3211156 0.3063436 0.3840581 0.3489135 0.4049100
#> [372] 0.4157184 0.3614834 0.3903234 0.4772533 0.4304268 0.4975292 0.5081465
#> [379] 0.6055968 0.4967962 0.4765257 0.5109528 0.5952098 0.5710703 0.5091904
#> [386] 0.4676893 0.4156366 0.3847657 0.3986055 0.4270329 0.4256214 0.4384139
#> [393] 0.3620371 0.4013846 0.3476632 0.3750143 0.3880683 0.4068815 0.4393193
#> [400] 0.3942579 0.3882881 0.3988136 0.4666453 0.4713418 0.5850794 0.5887536
#> [407] 0.5587789 0.5323390 0.4798827 0.5128599 0.5412602 0.3780070 0.4507327
#> [414] 0.3413968 0.3409663 0.2815777 0.4151418 0.4014258 0.4182146 0.3631024
#> [421] 0.3206767 0.4094738 0.4418074 0.4267461 0.3510119 0.4196212 0.4369260
#> [428] 0.5611301 0.4761971 0.5562918 0.4467465 0.3720391 0.4062921 0.3333406
#> [435] 0.2975883 0.2994069 0.3471894 0.4239455 0.4030005 0.4312843 0.3923873
#> [442] 0.4229431 0.4044157 0.3157021 0.2018358 0.3834718 0.3847805 0.5247784
#> [449] 0.4885487 0.5818268 0.5704645 0.6278703 0.6373951 0.5587964 0.5589505
#> [456] 0.4699992 0.4320366 0.4492506 0.4957221 0.4792945 0.4840558 0.4988874
#> [463] 0.4811205 0.4784799 0.4894140 0.4906589 0.5176980 0.5873182 0.5949545
#> [470] 0.5358544 0.5002811 0.5281563 0.4568034 0.4851329 0.4543207 0.3918352
#> [477] 0.4405271 0.3845054 0.3636555 0.4142411 0.2938572 0.3223071 0.2370605
#> [484] 0.2961961 0.3010312 0.4263224 0.4346359 0.4670908 0.5464010 0.5460656
#> [491] 0.4894043 0.4727297 0.4475091 0.4596936 0.4862694 0.4874916 0.4844980
#> [498] 0.3690910 0.2434915 0.4109559