DARTH-git / dampack

Decision Analytic Modeling (DAM) package is a suite of functions for analyzing and visualizing the health economic outputs of mathematical models
34 stars 9 forks source link

Decide on standard format for PSA results #7

Closed evaenns closed 5 years ago

evaenns commented 5 years ago

How should we require PSA results be formatted for input into dampack functions? We need to balance ease of use for the user (e.g. how will they typically have a PSA stored), flexibility, and clarity in structure of the functions. The format needs to be able to handle:

feralaes commented 5 years ago

I suggest that we require the PSA outputs to be formatted as two different types of objects:

Thoughts?

caleb-easterly commented 5 years ago

I think that sounds good! I actually just changed the ceac() function to take 2 matrices: costs and effectiveness, so that would work with your proposal, Fernando.

caleb-easterly commented 5 years ago

Do you think we should have a psa class? The function to create it could enforce some of the conditions (parameters, cost, effectiveness, etc., should all have the same number of rows, for example).

feralaes commented 5 years ago

Excellent!

Yeah, I think that could work. Would you generate a psa object from the cost, effectiveness and input parameter matrices? Or would you ask the user to create a psa matrix ex-ante and then the function will just make the matrix a psa class?

caleb-easterly commented 5 years ago

It could be something like make_psa_obj <- function(list_of_outcomes, cost, param), and then it could return a psa object. I don't know yet how many functions make use of the PSA results, but it could standardize it across the functions.

feralaes commented 5 years ago

It could be something like make_psa_obj <- function(list_of_outcomes, cost, param), and then it could return a psa object. I don't know yet how many functions make use of the PSA results, but it could standardize it across the functions.

Makes sense, although I can see a trade off here by adding a new function but also, one the psa object is created, then it's easier to use later on. Right of the bat, can think of at least 5 core functions that use psa: CEAC, EVPI, Expected loss curves (ELC), EVPPI, EVSI and also other ones like OWSA, TWSA, and TORNADO using regression metamodeling.

evaenns commented 5 years ago

I think a PSA object makes sense, given that it is the backbone of so many of these other functions. I think the key is to have the make_psa_obj() function have really clear error messages and that the PSA object have some nice summary methods so it is easy for a user to view what they have created.

caleb-easterly commented 5 years ago

see PSA object in #15