Skip to contents

compute_pfs() computes the progression-free-survival rate at specified times given a paramter sample.

Usage

compute_pfs(
  model,
  t,
  parameter_sample = NULL,
  warmup = 500L,
  nsim = 1000L,
  seed = NULL,
  ...
)

Arguments

model

an object of class srpmodel containing prior information

t

a vector of time-points at which the PFS rate should be computed

parameter_sample

a stanfit object with samples from the respective model.

warmup

integer, number of warm-up samples for the MCMC sampler before retaining samples; see warmup parameter in rstan::stan().

nsim

integer, number of samples to draw

seed

integer, fixed random seed; NULL for no fixed seed

...

further arguments passed to method implementations

Value

a data frame with samples of PFS rates at each of the time points in the vector t.

Examples

mdl <- create_srpmodel(A = define_srp_prior())
smpl <- sample_prior(mdl, nsim = 500, seed = 34L)
dplyr::filter(
  compute_pfs(mdl, t = seq(0, 12), parameter_sample = smpl),
  iter == 1
)
#> # A tibble: 13 × 4
#>     iter group_id     t   pfs
#>    <int> <chr>    <dbl> <dbl>
#>  1     1 A            0 1    
#>  2     1 A            1 0.887
#>  3     1 A            2 0.801
#>  4     1 A            3 0.743
#>  5     1 A            4 0.704
#>  6     1 A            5 0.677
#>  7     1 A            6 0.656
#>  8     1 A            7 0.639
#>  9     1 A            8 0.624
#> 10     1 A            9 0.610
#> 11     1 A           10 0.596
#> 12     1 A           11 0.583
#> 13     1 A           12 0.569