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.52139679 0.41798667 0.44198299 0.41894438 0.50590988 0.56334404
#>   [7] 0.69912203 0.55042305 0.48439103 0.56723968 0.52682453 0.51952381
#>  [13] 0.57513727 0.47504959 0.36923546 0.44533744 0.47207339 0.43928204
#>  [19] 0.41386850 0.48892719 0.52900733 0.55610909 0.44824892 0.54452209
#>  [25] 0.55125331 0.46283829 0.47201576 0.44192588 0.42681855 0.48746508
#>  [31] 0.50497688 0.48406912 0.44698050 0.41458452 0.47106624 0.48050504
#>  [37] 0.42888414 0.52762528 0.49078101 0.41445050 0.53802223 0.55389447
#>  [43] 0.59112552 0.43875139 0.41774275 0.24926772 0.44429705 0.37911055
#>  [49] 0.36124661 0.39925827 0.39084565 0.34682999 0.41269248 0.45309560
#>  [55] 0.49460537 0.45118640 0.50681834 0.42727705 0.35816210 0.39387719
#>  [61] 0.29015592 0.31141835 0.29632705 0.37860277 0.36165958 0.42507123
#>  [67] 0.45206836 0.40603293 0.41257473 0.54081946 0.41890631 0.42258150
#>  [73] 0.42861353 0.45338453 0.54592757 0.63866218 0.53253683 0.44024671
#>  [79] 0.39038030 0.38547859 0.50147077 0.38159841 0.34805770 0.41579008
#>  [85] 0.38120623 0.32668698 0.38925592 0.42982448 0.40114356 0.44696405
#>  [91] 0.41066732 0.40723866 0.32358654 0.24941578 0.35185545 0.33857817
#>  [97] 0.41340800 0.41983969 0.52615262 0.56620263 0.42704709 0.32046340
#> [103] 0.26533471 0.26874309 0.30849475 0.41233508 0.40023388 0.42725925
#> [109] 0.39765616 0.34198345 0.53069560 0.56371812 0.51713466 0.49378980
#> [115] 0.50789788 0.45600230 0.42569532 0.35312772 0.36993754 0.44777009
#> [121] 0.52434991 0.46813863 0.43798710 0.42242541 0.50675933 0.48814460
#> [127] 0.58134844 0.57413695 0.51652501 0.59085052 0.50500936 0.54257999
#> [133] 0.50344507 0.42788502 0.44657989 0.42974058 0.35370404 0.32116897
#> [139] 0.26971930 0.37527437 0.39195881 0.49389057 0.35022640 0.33657233
#> [145] 0.34674234 0.45153802 0.47000763 0.54676428 0.45248015 0.41837396
#> [151] 0.28412781 0.28064055 0.33671381 0.39886751 0.41460174 0.36651674
#> [157] 0.41589658 0.45782112 0.46790774 0.57368741 0.52638496 0.37731106
#> [163] 0.42887136 0.54661353 0.41610819 0.35159133 0.40882227 0.29122048
#> [169] 0.21606466 0.11294704 0.05445626 0.10163726 0.20448725 0.29540997
#> [175] 0.26053813 0.31804890 0.35696395 0.30614509 0.44296157 0.45466977
#> [181] 0.37011563 0.45177596 0.42759411 0.62699177 0.48993331 0.44017545
#> [187] 0.50984178 0.44738098 0.48478993 0.57477084 0.50404824 0.49042792
#> [193] 0.44165626 0.46764095 0.54802640 0.53043032 0.41315314 0.42451275
#> [199] 0.37423180 0.36674942 0.38747689 0.37510825 0.28337086 0.23673041
#> [205] 0.28929618 0.37288340 0.34628527 0.51083986 0.45182820 0.38495501
#> [211] 0.48456255 0.53842561 0.41334550 0.23616338 0.17913277 0.16123160
#> [217] 0.30917926 0.29554187 0.37214019 0.47637945 0.46771967 0.48418468
#> [223] 0.46693250 0.37396691 0.45585054 0.45480606 0.59059258 0.58939653
#> [229] 0.42671401 0.47288192 0.53719369 0.47251534 0.47255094 0.49006898
#> [235] 0.57423344 0.52266710 0.41159680 0.39624835 0.50884452 0.62769599
#> [241] 0.57625439 0.55292452 0.49537853 0.55566886 0.63270159 0.49433272
#> [247] 0.47274050 0.55975603 0.65854867 0.53680138 0.66982110 0.46924038
#> [253] 0.43464963 0.51280528 0.49086524 0.44441843 0.34989029 0.28130786
#> [259] 0.30336380 0.38968821 0.32743165 0.34954874 0.48014789 0.38272774
#> [265] 0.44797944 0.37019594 0.38645484 0.35064435 0.37292875 0.41655698
#> [271] 0.42212523 0.35378469 0.42795152 0.46675803 0.44631323 0.43559404
#> [277] 0.42087854 0.66091872 0.56503521 0.48908232 0.45151777 0.44876738
#> [283] 0.48458363 0.45644157 0.46185256 0.43076547 0.38337239 0.52109577
#> [289] 0.44088123 0.48003651 0.45630727 0.40702108 0.36994641 0.37732788
#> [295] 0.39160375 0.53656914 0.41855473 0.38958310 0.44178503 0.38851192
#> [301] 0.38457340 0.41859631 0.40965363 0.30583280 0.33232556 0.35941883
#> [307] 0.32622949 0.42997998 0.40056937 0.46344786 0.47762010 0.47924465
#> [313] 0.46061595 0.35302885 0.26302930 0.35837136 0.40577817 0.30741711
#> [319] 0.25241829 0.24488624 0.37290713 0.47769428 0.50615285 0.52059678
#> [325] 0.43456594 0.44406207 0.45342609 0.49904883 0.43076921 0.47507010
#> [331] 0.48233608 0.42900347 0.40568927 0.33727012 0.37817614 0.35050818
#> [337] 0.35885815 0.38769153 0.49116884 0.46311227 0.40290671 0.42380042
#> [343] 0.39516036 0.39133280 0.35539890 0.36540135 0.36717133 0.40311632
#> [349] 0.48237231 0.49481805 0.41688431 0.36400799 0.42202173 0.42343753
#> [355] 0.43533012 0.47934817 0.46555108 0.50288822 0.48696862 0.50138041
#> [361] 0.52477653 0.44934286 0.40473943 0.40487576 0.34564508 0.35035623
#> [367] 0.46326420 0.42246506 0.47595637 0.53166419 0.48466095 0.57231088
#> [373] 0.57714534 0.56254832 0.48437506 0.49367421 0.42720301 0.59502977
#> [379] 0.53379082 0.52295613 0.56063867 0.51927818 0.47644669 0.57701166
#> [385] 0.62196060 0.59329272 0.64543370 0.49789049 0.51005628 0.34694073
#> [391] 0.32690836 0.28557440 0.29791570 0.33961307 0.30945495 0.40725754
#> [397] 0.33079932 0.35069020 0.41008675 0.40523993 0.43243233 0.48131319
#> [403] 0.44798531 0.44514316 0.44698621 0.44226995 0.57015373 0.61375610
#> [409] 0.71470251 0.75777337 0.74745933 0.62175302 0.60488248 0.35527256
#> [415] 0.37753861 0.44585212 0.47870472 0.38996788 0.41575801 0.38776456
#> [421] 0.38846445 0.43212720 0.45232007 0.40913672 0.39776970 0.43103574
#> [427] 0.49034969 0.30290233 0.35340501 0.48998682 0.49082858 0.43148811
#> [433] 0.44115933 0.50359516 0.47005261 0.50782895 0.48569331 0.41167471
#> [439] 0.38402486 0.38565712 0.37020863 0.44544041 0.43036298 0.45766180
#> [445] 0.54763436 0.43984837 0.47105801 0.42969661 0.60839342 0.69309187
#> [451] 0.57497072 0.48776218 0.58132118 0.55007164 0.70281978 0.55812310
#> [457] 0.53693547 0.28568156 0.35984898 0.35821221 0.38171085 0.35206918
#> [463] 0.41521794 0.37074421 0.39988287 0.48370372 0.46359379 0.39537146
#> [469] 0.31176485 0.38242469 0.34604088 0.32264252 0.28455207 0.33885246
#> [475] 0.32752971 0.37067468 0.45761074 0.50615353 0.45245976 0.43634119
#> [481] 0.45172828 0.46222138 0.40380666 0.33578574 0.24668774 0.23947096
#> [487] 0.32297159 0.31422835 0.50192128 0.41193120 0.43135298 0.38457429
#> [493] 0.37775206 0.30388652 0.41495968 0.41022653 0.43901375 0.47398723
#> [499] 0.50052222 0.48140839