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.4357116 0.4320360 0.4175329 0.4080478 0.4834303 0.4038282 0.3281119
#>   [8] 0.4363921 0.2580597 0.3841427 0.3767979 0.4398141 0.4689129 0.4644749
#>  [15] 0.3848578 0.3889533 0.3020085 0.2184667 0.3034425 0.3524998 0.4679087
#>  [22] 0.3949297 0.3151299 0.2909214 0.3474406 0.4222429 0.4360084 0.4680264
#>  [29] 0.5017489 0.5000069 0.4122947 0.3731233 0.2989783 0.3583024 0.4340481
#>  [36] 0.3781556 0.4446068 0.3573465 0.3159514 0.3609651 0.3077495 0.3719724
#>  [43] 0.3477956 0.4125369 0.3812260 0.3035921 0.3723988 0.3583282 0.4226887
#>  [50] 0.3998634 0.4964426 0.4875446 0.3866000 0.3666616 0.3143742 0.2903979
#>  [57] 0.3941592 0.4004914 0.3759625 0.3692292 0.4078501 0.4454907 0.4343524
#>  [64] 0.4026768 0.4514957 0.4263405 0.3589591 0.3255393 0.3688076 0.3503433
#>  [71] 0.3566045 0.3955624 0.5122498 0.6169621 0.6176794 0.6408539 0.5650371
#>  [78] 0.5148479 0.3752149 0.2725692 0.3091375 0.3515603 0.3168459 0.3874087
#>  [85] 0.2293682 0.2265895 0.2868734 0.2583865 0.2523948 0.3711105 0.2447266
#>  [92] 0.4594990 0.4577232 0.4977938 0.5655103 0.5371129 0.6269071 0.5288444
#>  [99] 0.4652213 0.4851330 0.4131264 0.4876503 0.5260937 0.4465321 0.4064141
#> [106] 0.3521008 0.4344840 0.4496656 0.4813407 0.4761685 0.5364263 0.6392574
#> [113] 0.6108011 0.5676474 0.5733081 0.4474779 0.4454776 0.3621099 0.3530466
#> [120] 0.3478157 0.3811297 0.4502681 0.4296729 0.4031925 0.4463466 0.4687373
#> [127] 0.4307550 0.4612269 0.4495964 0.4717006 0.4927047 0.5773589 0.5310444
#> [134] 0.4932931 0.3366978 0.2983003 0.3488350 0.3015338 0.3412380 0.3639227
#> [141] 0.5073960 0.3922562 0.4803249 0.4109557 0.3598684 0.2894731 0.2745067
#> [148] 0.3472155 0.4096298 0.3815423 0.4978624 0.5348885 0.4874348 0.4487556
#> [155] 0.5045553 0.4302163 0.4258498 0.3078843 0.2934095 0.3620502 0.3851787
#> [162] 0.3939012 0.3379077 0.3387758 0.4514842 0.4534224 0.4429468 0.4564357
#> [169] 0.4372997 0.4453394 0.4606007 0.4142834 0.4723314 0.5171624 0.4630050
#> [176] 0.5276533 0.4279383 0.4820329 0.4404698 0.4680797 0.5543828 0.5029866
#> [183] 0.5150768 0.4927152 0.3965423 0.4095113 0.5222890 0.6455925 0.6538126
#> [190] 0.5584895 0.5260401 0.5042014 0.4746998 0.4600562 0.4872105 0.4648324
#> [197] 0.3812455 0.2765625 0.2856956 0.2844320 0.3028436 0.3248520 0.3537411
#> [204] 0.3740320 0.4224004 0.5264914 0.4372992 0.4405042 0.4503806 0.4774711
#> [211] 0.4956114 0.5424800 0.4164614 0.4646233 0.4257628 0.2833803 0.2065330
#> [218] 0.1932228 0.2340412 0.3541556 0.4288241 0.4598664 0.4598499 0.4527483
#> [225] 0.3504656 0.5034934 0.3778426 0.3434000 0.3793361 0.3988091 0.4290587
#> [232] 0.3955770 0.3732837 0.4232940 0.3627327 0.4410957 0.3629820 0.4031576
#> [239] 0.2961097 0.3360716 0.3904288 0.5359172 0.4646796 0.4821275 0.5247702
#> [246] 0.6439922 0.6269307 0.5374012 0.5333729 0.5157392 0.4924653 0.4429095
#> [253] 0.4981961 0.5588148 0.5528685 0.5349590 0.5358506 0.5740252 0.5350594
#> [260] 0.5474129 0.5296297 0.5341842 0.4805952 0.5997004 0.5308493 0.4072038
#> [267] 0.4062001 0.3326402 0.2149192 0.3368166 0.2878355 0.3603030 0.4094665
#> [274] 0.4202937 0.4261425 0.3489519 0.3828607 0.3611520 0.2627823 0.4110120
#> [281] 0.4551523 0.4718002 0.4446780 0.4749797 0.5005571 0.4989862 0.5131773
#> [288] 0.5248044 0.4831330 0.4197770 0.4161592 0.3627010 0.3974335 0.3967878
#> [295] 0.4619095 0.5523468 0.4398476 0.4841476 0.5066929 0.4536881 0.3962990
#> [302] 0.4595824 0.4426749 0.4371874 0.4316084 0.4633821 0.4030147 0.3769535
#> [309] 0.3384320 0.3237713 0.3378741 0.3076803 0.2917569 0.3122778 0.3426280
#> [316] 0.3114908 0.2400666 0.2820625 0.3665593 0.3631120 0.4376698 0.3972561
#> [323] 0.4634640 0.4563835 0.4151428 0.5042898 0.4317638 0.4453806 0.4562902
#> [330] 0.5727548 0.5807511 0.6118016 0.6450502 0.7261851 0.4632954 0.4898409
#> [337] 0.4480045 0.4743750 0.4540551 0.5116386 0.4903761 0.3735553 0.4450123
#> [344] 0.2771195 0.3064598 0.5368046 0.5293880 0.4782110 0.5321819 0.5079564
#> [351] 0.5894153 0.5462863 0.5159910 0.4775494 0.4676299 0.4315445 0.5071983
#> [358] 0.4871836 0.5549321 0.4549163 0.3600157 0.4680499 0.4127172 0.3585642
#> [365] 0.3384902 0.3539994 0.3107351 0.3869098 0.4770670 0.4966082 0.4831371
#> [372] 0.4567945 0.4059218 0.4654109 0.3414455 0.2842858 0.2797962 0.4262556
#> [379] 0.4726566 0.4440384 0.4007363 0.4114116 0.2182747 0.4043698 0.4266947
#> [386] 0.3786381 0.3677937 0.3531460 0.3140645 0.3542771 0.4093028 0.4479726
#> [393] 0.4270880 0.4367689 0.2907114 0.3401217 0.3073417 0.2914481 0.2841442
#> [400] 0.2673779 0.2277668 0.1982354 0.4321695 0.4342756 0.4568303 0.5064088
#> [407] 0.5324525 0.5169760 0.3016922 0.3849385 0.4017948 0.3400651 0.3714349
#> [414] 0.3217554 0.2944534 0.2783475 0.4050675 0.2919255 0.4510979 0.6580919
#> [421] 0.5778797 0.5184718 0.4762136 0.4921838 0.5260820 0.3906496 0.2850642
#> [428] 0.2697207 0.3727846 0.3996692 0.4041478 0.4742556 0.4413317 0.4585664
#> [435] 0.3817629 0.3722261 0.3894287 0.3193263 0.2564585 0.3692110 0.4486759
#> [442] 0.4196825 0.5049258 0.3940857 0.5064542 0.5536217 0.5502921 0.5329135
#> [449] 0.4347168 0.4566305 0.4136509 0.4252798 0.5560030 0.4852495 0.4776435
#> [456] 0.4021572 0.3732698 0.2382901 0.3962424 0.4564715 0.5382439 0.5383479
#> [463] 0.5401695 0.4194548 0.4276306 0.4425884 0.4430440 0.4198748 0.4589758
#> [470] 0.4229256 0.4651514 0.5344711 0.4924502 0.5073751 0.5448081 0.5523177
#> [477] 0.4943050 0.4533221 0.4789343 0.4894337 0.5177460 0.4935947 0.4517181
#> [484] 0.3866980 0.4707581 0.5047838 0.4291110 0.3877994 0.4313677 0.4390491
#> [491] 0.4623864 0.6396392 0.6767521 0.7788877 0.5546150 0.5287423 0.4794256
#> [498] 0.4238228 0.4637529 0.3723593