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.5007572 0.4238309 0.3106277 0.2965920 0.3449803 0.4136936 0.4123459
#>   [8] 0.3383047 0.3712146 0.3314910 0.2759285 0.2742917 0.2762831 0.2648702
#>  [15] 0.3274263 0.5324718 0.4386012 0.4476237 0.4086590 0.4263236 0.4529419
#>  [22] 0.3950783 0.3935744 0.3864010 0.4423536 0.6400792 0.5687235 0.6130140
#>  [29] 0.5663576 0.5665604 0.5764527 0.4246270 0.3337019 0.3806209 0.3800264
#>  [36] 0.3568675 0.4460971 0.4195603 0.5401539 0.4144676 0.2337180 0.2767963
#>  [43] 0.2692241 0.3542134 0.3940875 0.4245094 0.4291736 0.4491062 0.4676268
#>  [50] 0.4714196 0.4792138 0.5055291 0.5161028 0.5015503 0.4928931 0.5127194
#>  [57] 0.5022023 0.4841288 0.4588695 0.4274176 0.3522165 0.2844688 0.3227563
#>  [64] 0.3079032 0.3980329 0.4112647 0.3445162 0.3260923 0.3399571 0.4253477
#>  [71] 0.4338968 0.4327317 0.4802346 0.4547473 0.4725008 0.4943246 0.4197340
#>  [78] 0.5199089 0.5142265 0.4263829 0.4819350 0.4086651 0.4008291 0.3216719
#>  [85] 0.4034092 0.4153598 0.4041925 0.4837136 0.4008944 0.4261192 0.4531048
#>  [92] 0.4668536 0.4525818 0.3779133 0.4105506 0.4001562 0.3404653 0.3297589
#>  [99] 0.3807548 0.3675258 0.3501149 0.3294131 0.3720660 0.3585781 0.4204802
#> [106] 0.3942587 0.4016500 0.4711256 0.4134222 0.4821557 0.5795208 0.6020132
#> [113] 0.6497781 0.5886482 0.4347610 0.3966755 0.5067431 0.3591143 0.3236030
#> [120] 0.3357823 0.3744749 0.3766195 0.4206875 0.3849120 0.4456647 0.4497640
#> [127] 0.4428242 0.4838959 0.4378570 0.4196017 0.4316776 0.5007235 0.4611750
#> [134] 0.5042575 0.3473887 0.4191988 0.4127044 0.3694620 0.3727630 0.3459282
#> [141] 0.3497686 0.3201912 0.3556317 0.3806119 0.4730304 0.6435746 0.6435084
#> [148] 0.4399156 0.4515870 0.4863115 0.5226756 0.3703307 0.2628676 0.2819992
#> [155] 0.3034240 0.2477890 0.3135801 0.4406983 0.5207832 0.5443822 0.4336311
#> [162] 0.5453843 0.4148698 0.4239095 0.4123654 0.4935284 0.5050218 0.5332479
#> [169] 0.5316236 0.5386921 0.4641088 0.4163388 0.3377729 0.4298709 0.4177505
#> [176] 0.3775369 0.4153468 0.4815991 0.5138774 0.6543230 0.5810801 0.7248325
#> [183] 0.7250979 0.6372763 0.6386709 0.5499525 0.5443030 0.5776818 0.5461258
#> [190] 0.4127162 0.4777589 0.5825912 0.5168682 0.4844875 0.4203674 0.4632709
#> [197] 0.3959494 0.3838309 0.3835260 0.4277566 0.4395414 0.5288093 0.5753537
#> [204] 0.5291763 0.5554207 0.4734817 0.5285313 0.5082795 0.5617859 0.4764839
#> [211] 0.5474402 0.6083796 0.5722831 0.5918207 0.6044816 0.5463901 0.4395375
#> [218] 0.5105603 0.5280343 0.5230063 0.3884957 0.3611694 0.4787663 0.5831201
#> [225] 0.6113362 0.7101943 0.7052558 0.6758988 0.5936529 0.5429978 0.5361278
#> [232] 0.5049072 0.4735127 0.4576451 0.3621900 0.3478250 0.3966902 0.2200115
#> [239] 0.2594381 0.3324267 0.3207113 0.4055275 0.4647460 0.4721953 0.4149203
#> [246] 0.4536011 0.4531207 0.4632968 0.4834715 0.4817340 0.4832905 0.4104531
#> [253] 0.3980782 0.3508912 0.3044382 0.2322485 0.3670141 0.4831313 0.5372837
#> [260] 0.6716468 0.6074175 0.4311722 0.4451477 0.5314811 0.4684978 0.5362644
#> [267] 0.5149338 0.4953105 0.4244920 0.4015610 0.4264960 0.3853714 0.4210947
#> [274] 0.4877807 0.5059798 0.4370751 0.4241713 0.4548357 0.4086118 0.4498907
#> [281] 0.3591936 0.3005181 0.3305847 0.2055024 0.2231628 0.2367595 0.3314128
#> [288] 0.2868232 0.3671826 0.4535947 0.4145203 0.3315979 0.5212976 0.4393924
#> [295] 0.5443243 0.3706171 0.2836988 0.4068990 0.3715932 0.4179704 0.4920881
#> [302] 0.5166087 0.5795082 0.6720197 0.6390423 0.4546201 0.4197805 0.3676819
#> [309] 0.4364419 0.5086778 0.5243622 0.4532237 0.4545554 0.4414944 0.5114282
#> [316] 0.5283080 0.6499364 0.5545766 0.6041907 0.5513854 0.5227516 0.4276378
#> [323] 0.3849996 0.2882423 0.3223022 0.3406872 0.4153688 0.4850815 0.4314878
#> [330] 0.4429465 0.3419800 0.2852920 0.3431723 0.3675773 0.4071760 0.4443656
#> [337] 0.4062210 0.4233266 0.4465185 0.4232576 0.3468108 0.5263285 0.5574729
#> [344] 0.5622929 0.5901284 0.5285139 0.4026957 0.3737974 0.4798895 0.4455325
#> [351] 0.4417589 0.4105856 0.4938863 0.5344259 0.5759204 0.5499576 0.5279019
#> [358] 0.5533472 0.4543517 0.3028088 0.2568750 0.3057879 0.3238496 0.4541043
#> [365] 0.4913922 0.4217710 0.4038170 0.4424106 0.4007927 0.4193897 0.5152675
#> [372] 0.7137063 0.4523201 0.4246903 0.4555969 0.3743324 0.4458518 0.3562517
#> [379] 0.3018627 0.3279085 0.4954938 0.4867728 0.5061425 0.3998304 0.2655265
#> [386] 0.2380558 0.4150055 0.4564901 0.4995675 0.4879615 0.4583746 0.4772472
#> [393] 0.3941601 0.3288374 0.3081424 0.3558742 0.4304017 0.4359183 0.4830008
#> [400] 0.4758902 0.4584250 0.5205396 0.6223368 0.6068306 0.5338812 0.4533382
#> [407] 0.5170387 0.3881464 0.4643604 0.4574739 0.3676874 0.4807444 0.4858593
#> [414] 0.4615785 0.4256827 0.4408085 0.3965764 0.3485438 0.3912302 0.4294706
#> [421] 0.4222295 0.4603437 0.5285579 0.4526032 0.3284467 0.3202350 0.3367871
#> [428] 0.4027478 0.3869102 0.4749169 0.3434290 0.2873330 0.4053369 0.4029026
#> [435] 0.4989038 0.4726332 0.4737222 0.4015497 0.4821994 0.3456416 0.3563205
#> [442] 0.4804272 0.5017758 0.4373864 0.4070655 0.3484039 0.3242805 0.3727289
#> [449] 0.3485685 0.3297268 0.2842116 0.2618863 0.3242417 0.3620995 0.3736939
#> [456] 0.4209123 0.4248622 0.4535028 0.4196497 0.4115522 0.3667197 0.4094269
#> [463] 0.4992346 0.5201624 0.2938279 0.4021043 0.4296141 0.4050307 0.3422491
#> [470] 0.3449756 0.3147812 0.3946176 0.4372362 0.4307213 0.4592996 0.4632964
#> [477] 0.4298821 0.3853679 0.3935317 0.4691779 0.5449299 0.4950708 0.4797249
#> [484] 0.4534322 0.3722308 0.3445832 0.4115979 0.3948840 0.3954815 0.3956829
#> [491] 0.4107644 0.4458628 0.4796665 0.4762103 0.4019346 0.3191728 0.3953195
#> [498] 0.3984624 0.4185280 0.4763372