Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSA using uncertainty in a survival object #340

Open
andreasakarlsson opened this issue Nov 7, 2019 · 1 comment
Open

PSA using uncertainty in a survival object #340

andreasakarlsson opened this issue Nov 7, 2019 · 1 comment

Comments

@andreasakarlsson
Copy link

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().

@KZARCA
Copy link
Collaborator

KZARCA commented Nov 7, 2019

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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants