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.43026211  0.45131850  0.39380979  0.52566904  0.44627087  0.40601049
#>   [7]  0.42065494  0.43232603  0.55707081  0.39378351  0.37215468  0.48241023
#>  [13]  0.41488911  0.39157462  0.38519177  0.37408688  0.34644024  0.37242171
#>  [19]  0.55810838  0.50591901  0.54552695  0.50487546  0.43249218  0.49550168
#>  [25]  0.47712592  0.49542807  0.51025900  0.51743746  0.46142855  0.49274214
#>  [31]  0.46368892  0.50577985  0.45135781  0.48476940  0.38564123  0.46903608
#>  [37]  0.44432307  0.40453772  0.44404011  0.33044144  0.30762967  0.38202722
#>  [43]  0.42061159  0.44898588  0.43482690  0.48073491  0.48035114  0.49709696
#>  [49]  0.52202583  0.48396963  0.40502205  0.52087296  0.39597659  0.26604342
#>  [55]  0.39714875  0.37597313  0.40343790  0.45427623  0.38469723  0.36827904
#>  [61]  0.43468787  0.44794407  0.37109012  0.51155412  0.53745690  0.44930280
#>  [67]  0.33623861  0.38107450  0.39356363  0.45480340  0.43631623  0.38563574
#>  [73]  0.38009493  0.48449430  0.44525360  0.53119916  0.51525312  0.43594639
#>  [79]  0.49315951  0.43762219  0.46306671  0.65249871  0.60094340  0.66245219
#>  [85]  0.62746516  0.63169440  0.59165687  0.47029510  0.42848547  0.47201859
#>  [91]  0.42692822  0.39905786  0.43341521  0.38041716  0.30917151  0.35005693
#>  [97]  0.37495792  0.40789895  0.26295576  0.20769909  0.33306749  0.29157882
#> [103]  0.28984833  0.29070472  0.20820384  0.28809408  0.29968313  0.17920711
#> [109] -0.02466640  0.11271554  0.35793027  0.33981862  0.38686518  0.34292116
#> [115]  0.32688148  0.31911403  0.31443727  0.18681964  0.26829858  0.41575809
#> [121]  0.48857595  0.46854573  0.41090012  0.38954611  0.20631790  0.14501242
#> [127]  0.06914466  0.22729848  0.31011661  0.54072940  0.65715032  0.66157336
#> [133]  0.42910298  0.45590459  0.40694884  0.44029181  0.52155298  0.21630453
#> [139]  0.19751340  0.29011982  0.37564498  0.41567967  0.43212050  0.41782149
#> [145]  0.47119115  0.41168223  0.42281810  0.47357704  0.44275536  0.44531542
#> [151]  0.45718276  0.39439875  0.50107347  0.58748935  0.56783330  0.70720323
#> [157]  0.66508042  0.51749751  0.43246835  0.38490571  0.39485253  0.40500383
#> [163]  0.41599551  0.41276655  0.48060437  0.48248167  0.50904945  0.46227557
#> [169]  0.37447389  0.36598625  0.42591361  0.44896649  0.48278696  0.46534016
#> [175]  0.50063995  0.46908939  0.45926367  0.54530222  0.35630344  0.27641421
#> [181]  0.21907666  0.27390022  0.36720687  0.30322413  0.38544659  0.34068356
#> [187]  0.36004974  0.31488098  0.32467703  0.43869342  0.44209702  0.56232409
#> [193]  0.55476155  0.64039459  0.72174034  0.78623222  0.70022312  0.56437573
#> [199]  0.48492826  0.44872881  0.35335999  0.41575069  0.49913488  0.35477569
#> [205]  0.35206698  0.38863956  0.33757738  0.32885254  0.45612472  0.24553768
#> [211]  0.31549807  0.46051346  0.40364873  0.38774097  0.45330294  0.44589433
#> [217]  0.50671905  0.52949775  0.52931769  0.58304448  0.56146996  0.55133534
#> [223]  0.39359948  0.40314135  0.36255157  0.36057361  0.31590690  0.25282163
#> [229]  0.29983377  0.32110260  0.29331261  0.32886307  0.33856503  0.31409646
#> [235]  0.34780030  0.40352436  0.46419103  0.47741234  0.50010524  0.44536449
#> [241]  0.45419632  0.50456553  0.52983494  0.52852609  0.50704201  0.50867951
#> [247]  0.48546658  0.46586884  0.42256010  0.42841704  0.33984140  0.41270775
#> [253]  0.40527497  0.48808369  0.56185145  0.63659906  0.56626357  0.60852272
#> [259]  0.52772054  0.62656843  0.47830831  0.49079606  0.42026867  0.29880301
#> [265]  0.28917272  0.19333139  0.35758887  0.39614910  0.33855142  0.31587349
#> [271]  0.29496170  0.38702940  0.51784601  0.50943283  0.46706551  0.43746131
#> [277]  0.43562390  0.48460158  0.59200439  0.44989731  0.47058063  0.45718062
#> [283]  0.49240008  0.41220809  0.46086929  0.44941695  0.42400063  0.35046454
#> [289]  0.44708000  0.45677424  0.38316863  0.41526538  0.45927466  0.48520191
#> [295]  0.50961757  0.42682758  0.37253095  0.34665029  0.37465316  0.38013675
#> [301]  0.33357080  0.35609150  0.37507119  0.38124110  0.34200598  0.34825777
#> [307]  0.46129900  0.37332596  0.34789886  0.47925652  0.52624042  0.53112756
#> [313]  0.54732551  0.54079418  0.41354558  0.33864067  0.41602387  0.35498754
#> [319]  0.42333472  0.46810806  0.39548106  0.36354764  0.48869541  0.52741879
#> [325]  0.42649374  0.42863734  0.41385816  0.58411683  0.59293527  0.55163281
#> [331]  0.58590745  0.55190623  0.54884218  0.57134409  0.42999287  0.45896290
#> [337]  0.44869111  0.36817601  0.43573223  0.44333539  0.41152657  0.42359905
#> [343]  0.40106156  0.53655442  0.44246981  0.39005279  0.44271767  0.48185496
#> [349]  0.42168389  0.45989266  0.49577922  0.58227179  0.66944430  0.59902919
#> [355]  0.44665204  0.34166558  0.46434209  0.50782390  0.40743226  0.51129656
#> [361]  0.42603957  0.46911668  0.43102833  0.42157730  0.46687866  0.43265504
#> [367]  0.48870237  0.43221409  0.39875686  0.36157435  0.35230193  0.29089211
#> [373]  0.34843682  0.28521506  0.31282678  0.36970682  0.42516159  0.44280629
#> [379]  0.36117980  0.26977567  0.46226240  0.53281084  0.49700218  0.50052753
#> [385]  0.48565322  0.43854094  0.47036878  0.51950964  0.50350011  0.39736052
#> [391]  0.43523459  0.57187860  0.55094152  0.44877716  0.44615699  0.38490590
#> [397]  0.42606742  0.32739912  0.31893728  0.33013495  0.36173795  0.39825607
#> [403]  0.40104530  0.39849026  0.51719084  0.57531063  0.58699785  0.51591564
#> [409]  0.39834757  0.35339234  0.41170637  0.40548237  0.48772060  0.58029072
#> [415]  0.61769147  0.51037902  0.39419750  0.36366981  0.32280753  0.36188550
#> [421]  0.38360585  0.45394989  0.47325208  0.45772638  0.39189669  0.48359494
#> [427]  0.49077700  0.41346304  0.47895627  0.51075646  0.49475015  0.67206165
#> [433]  0.78617259  0.64813552  0.48056132  0.27584649  0.31367343  0.30295836
#> [439]  0.39236681  0.34235550  0.36990423  0.45437103  0.47702290  0.71272853
#> [445]  0.71868972  0.57651708  0.56752183  0.55950798  0.44422059  0.36069151
#> [451]  0.32745701  0.24551903  0.35380013  0.37427931  0.49368383  0.40456225
#> [457]  0.37048405  0.31617099  0.34029750  0.30436956  0.32229244  0.31665563
#> [463]  0.40844061  0.41094008  0.42591136  0.41494378  0.37189488  0.36088748
#> [469]  0.35844725  0.44536503  0.47805643  0.47955758  0.45077954  0.36294735
#> [475]  0.44412157  0.49745713  0.46698855  0.38225442  0.47695565  0.48997130
#> [481]  0.54433380  0.45102317  0.48759618  0.51987230  0.54270875  0.50587012
#> [487]  0.45381791  0.44889229  0.50718211  0.46641558  0.39455903  0.32197232
#> [493]  0.38476648  0.44501432  0.41767731  0.45520990  0.48393261  0.52286548
#> [499]  0.67142350  0.48122809