PSA using uncertainty in a survival object
andreasakarlsson opened this issue · 1 comments
Calculating transition probabilities from a flexsurv
survival objects works well with compute_surv()
.
It seems natural to use the uncertainty in the survival estimate from the object for probabilistic sensitivity analyses. Is there functionality to use the survival object for resampling transition probabilities in define_psa()
? If not, this would be a very convenient feature.
I understand that I can use define_survival()
with explicitly defined parameters in define_parameters()
and define_psa()
.
Hi,
You're right, that's an important feature to add. I will focus on it in a near future. In the meanwhile, what you could do is to create a loop over a function which includes your whole program. Something like that:
a <- rnorm(1000, 100, 10)
b <- rbeta(1000, 25, 75)
compute_all <- function(i){
## your script comes here
define_parameters(
## anything
a = a[i],
b = b[i],
...
=
)
define_transition(
a, C,
b, C
)
...
}
purrr::map(seq_len(1000), compute_all))