def report_CEA_CBA(multi_cohort_outcomes_SOC, multi_cohort_outcomes_NSB): """ performs cost-effectiveness and cost-benefit analyses :param multi_cohort_outcomes_SOC: outcomes of a multi-cohort simulated under SOC diagnostic :param multi_cohort_outcomes_NSB: outcomes of a multi-cohort simulated under NSB diagnostic """ # define two strategies SOC_diagnostic_strategy = Econ.Strategy( name='SOC Diagnostic', cost_obs=multi_cohort_outcomes_SOC.meanCosts, effect_obs=multi_cohort_outcomes_SOC.totalYLL, color='green' ) NSB_diagnostic_strategy = Econ.Strategy( name='NSB Diagnostic', cost_obs=multi_cohort_outcomes_NSB.meanCosts, effect_obs=multi_cohort_outcomes_NSB.totalYLL, color='blue' ) # do CEA CEA = Econ.CEA( strategies=[SOC_diagnostic_strategy, NSB_diagnostic_strategy], if_paired=True, health_measure='d' ) # show the cost-effectiveness plane show_ce_figure(CEA=CEA) # report the CE table CEA.build_CE_table( interval_type='p', # prediction intervals alpha=D.ALPHA, cost_digits=0, effect_digits=2, icer_digits=2) # CBA NBA = Econ.CBA( strategies=[SOC_diagnostic_strategy, NSB_diagnostic_strategy], if_paired=True, health_measure='d' ) # show the net monetary benefit figure NBA.graph_incremental_NMBs( min_wtp=0, max_wtp=50000, title='Cost-Benefit Analysis', x_label='Willingness-To-Pay for One Additional QALY ($)', y_label='Incremental Net Monetary Benefit ($)', interval_type='p', show_legend=True, figure_size=(6, 5) )
def report_CEA_CBA(multi_trees_P, multi_trees_N): """ performs cost-effectiveness and cost-benefit analyses :param multi_cohort_outcomes_mono: outcomes of a multi-cohort simulated under mono therapy :param multi_cohort_outcomes_combo: outcomes of a multi-cohort simulated under combination therapy """ # define two strategies Palivizumab_therapy_strategy = Econ.Strategy( name='Palivizumab Therapy', cost_obs=multi_trees_P.PCosts, effect_obs=multi_trees_P.PQALYs, color='green' ) No_prophylaxis_strategy = Econ.Strategy( name='No Prophylaxis', cost_obs=multi_trees_N.NCosts, effect_obs=multi_trees_N.NQALYs, color='blue' ) # do CEA CEA = Econ.CEA( strategies=[Palivizumab_therapy_strategy, No_prophylaxis_strategy], if_paired=True ) # show the cost-effectiveness plane show_ce_figure(CEA=CEA) # report the CE table CEA.build_CE_table( interval_type='p', # prediction intervals alpha=D.ALPHA, cost_digits=0, effect_digits=2, icer_digits=2) # CBA NBA = Econ.CBA( strategies=[Palivizumab_therapy_strategy, No_prophylaxis_strategy], if_paired=True ) # show the net monetary benefit figure NBA.graph_incremental_NMBs( min_wtp=0, max_wtp=5000000, title='Cost-Benefit Analysis', x_label='Willingness-To-Pay for One Additional QALY ($)', y_label='Incremental Net Monetary Benefit ($)', interval_type='p', show_legend=True, figure_size=(6, 5) )
def report_CEA_CBA(multi_cohort_outcomes_no, multi_cohort_outcomes_asp): # define two strategies no_therapy_strategy = Econ.Strategy( name='Mono Therapy', cost_obs=multi_cohort_outcomes_no.meanCosts, effect_obs=multi_cohort_outcomes_asp.meanQALYs, color='green' ) asp_therapy_strategy = Econ.Strategy( name='Combination Therapy', cost_obs=multi_cohort_outcomes_asp.meanCosts, effect_obs=multi_cohort_outcomes_no.meanQALYs, color='blue' ) # do CEA CEA = Econ.CEA( strategies=[no_therapy_strategy, asp_therapy_strategy], if_paired=True ) # show the cost-effectiveness plane show_ce_figure(CEA=CEA) # report the CE table CEA.build_CE_table( interval_type='p', # prediction intervals alpha=D.ALPHA, cost_digits=0, effect_digits=2, icer_digits=2) # CBA NBA = Econ.CBA( strategies=[no_therapy_strategy, asp_therapy_strategy], if_paired=True ) # show the net monetary benefit figure NBA.graph_incremental_NMBs( min_wtp=0, max_wtp=50000, title='Cost-Benefit Analysis', x_label='Willingness-To-Pay for One Additional QALY ($)', y_label='Incremental Net Monetary Benefit ($)', interval_type='p', show_legend=True, figure_size=(6, 5) )
def report_CEA_CBA(sim_outcomes_amino, sim_outcomes_immuno): """ performs cost-effectiveness and cost-benefit analyses :param sim_outcomes_amino: outcomes of a cohort simulated under aminosalicylate therapy :param sim_outcomes_immuno: outcomes of a cohort simulated under immunosuppresive therapy """ # define two strategies amino_therapy_strategy = Econ.Strategy( name='Aminosalicylate Therapy', cost_obs=sim_outcomes_amino.costs, effect_obs=sim_outcomes_amino.numPatientsAlive, color='green') immuno_therapy_strategy = Econ.Strategy( name='Immunosuppresive Therapy', cost_obs=sim_outcomes_immuno.costs, effect_obs=sim_outcomes_immuno.numPatientsAlive, color='blue') # do CEA CEA = Econ.CEA( strategies=[amino_therapy_strategy, immuno_therapy_strategy], if_paired=False) # show the cost-effectiveness plane show_ce_figure(CEA=CEA) # report the CE table CEA.build_CE_table(interval_type='c', alpha=D.ALPHA, cost_digits=0, effect_digits=2, icer_digits=2) # CBA NBA = Econ.CBA( strategies=[amino_therapy_strategy, immuno_therapy_strategy], if_paired=False) # show the net monetary benefit figure NBA.graph_incremental_NMBs( min_wtp=0, max_wtp=50000, title='Cost-Benefit Analysis', x_label='Willingness-to-pay for one additional QALY ($)', y_label='Incremental Net Monetary Benefit ($)', interval_type='c', show_legend=True, figure_size=(6, 5))
def report_CEA_CBA(sim_outcomes_SOC, sim_outcomes_NSB): """ performs cost-effectiveness and cost-benefit analyses :param sim_outcomes_mono: outcomes of a cohort simulated under mono therapy :param sim_outcomes_combo: outcomes of a cohort simulated under combination therapy """ # define two strategies SOC_diagnostic_strategy = Econ.Strategy( name='SOC Diagnostic', cost_obs=sim_outcomes_SOC.costsPresenting, effect_obs=sim_outcomes_SOC.listYLLPresenting, color='green') sim_outcomes_NSB = Econ.Strategy( name='NSB Diagnostic', cost_obs=sim_outcomes_NSB.costsPresenting, effect_obs=sim_outcomes_NSB.listYLLPresenting, color='blue') # do CEA CEA = Econ.CEA(strategies=[SOC_diagnostic_strategy, sim_outcomes_NSB], if_paired=False, health_measure='d') # show the cost-effectiveness plane show_ce_figure(CEA=CEA) # report the CE table CEA.build_CE_table(interval_type='c', alpha=D.ALPHA, cost_digits=0, effect_digits=2, icer_digits=2) # CBA NBA = Econ.CBA(strategies=[SOC_diagnostic_strategy, sim_outcomes_NSB], if_paired=False) # show the net monetary benefit figure NBA.graph_incremental_NMBs( min_wtp=0, max_wtp=50000, title='Cost-Benefit Analysis', x_label='Willingness-to-pay for one additional YLL ($)', y_label='Incremental Net Monetary Benefit ($)', interval_type='c', show_legend=True, figure_size=(6, 5))
def report_CEA_CBA(sim_outcomes_none, sim_outcomes_treat): """ performs cost-effectiveness and cost-benefit analyses :param sim_outcomes_mono: outcomes of a cohort simulated under mono therapy :param sim_outcomes_combo: outcomes of a cohort simulated under combination therapy """ # define two strategies none_therapy_strategy = Econ.Strategy( name='No Therapy', cost_obs=sim_outcomes_none.costs, effect_obs=sim_outcomes_none.nTotalCured, color='green') treat_therapy_strategy = Econ.Strategy( name='Intervention to Increase Adherence', cost_obs=sim_outcomes_treat.costs, effect_obs=sim_outcomes_treat.nTotalCured, color='blue') # do CEA CEA = Econ.CEA(strategies=[none_therapy_strategy, treat_therapy_strategy], if_paired=False) # show the cost-effectiveness plane show_ce_figure(CEA=CEA) # report the CE table CEA.build_CE_table(interval_type='c', alpha=D.ALPHA, cost_digits=0, effect_digits=2, icer_digits=2) # CBA NBA = Econ.CBA(strategies=[none_therapy_strategy, treat_therapy_strategy], if_paired=False) # show the net monetary benefit figure NBA.graph_incremental_NMBs( min_wtp=0, max_wtp=1000, title='Cost-Benefit Analysis', x_label='Willingness-to-pay for one additional patient cured ($)', y_label='Incremental Net Monetary Benefit ($)', interval_type='c', show_legend=True, figure_size=(6, 5))
def report_CEA_CBA(sim_outcomes_NO, sim_outcomes_ASP): # define two strategies NO_therapy_strategy = Econ.Strategy(name='No Therapy', cost_obs=sim_outcomes_NO.costs, effect_obs=sim_outcomes_NO.utilities, color='green') ASP_therapy_strategy = Econ.Strategy(name='Aspirin Therapy', cost_obs=sim_outcomes_ASP.costs, effect_obs=sim_outcomes_ASP.utilities, color='blue') # do CEA CEA = Econ.CEA(strategies=[NO_therapy_strategy, ASP_therapy_strategy], if_paired=False) # show the cost-effectiveness plane show_ce_figure(CEA=CEA) # report the CE table CEA.build_CE_table(interval_type='c', alpha=D.ALPHA, cost_digits=0, effect_digits=2, icer_digits=2) # CBA NBA = Econ.CBA(strategies=[NO_therapy_strategy, ASP_therapy_strategy], if_paired=False) # show the net monetary benefit figure NBA.graph_incremental_NMBs( min_wtp=0, max_wtp=100000, title='Cost-Benefit Analysis', x_label='Willingness-to-pay for one additional QALY ($)', y_label='Incremental Net Monetary Benefit ($)', interval_type='c', show_legend=True, figure_size=(6, 5))
simulation.get_sumStat_NoOS_utility().get_mean()) print('95% Confidence Interval for No OS Utility', simulation.get_sumStat_NoOS_utility().get_t_CI(alpha)) print(" ") print(" ") # CEA plot # currently turning out weird but hopefully will have more of a 'cloud' when we randomize the simulation parameters s1 = ce.Strategy('OpSmile', cost_obs=simulation.get_OS_costs(), effect_obs=simulation.get_OS_utilities()) s2 = ce.Strategy('No OpSmile', cost_obs=simulation.get_NoOS_costs(), effect_obs=simulation.get_NoOS_utilities()) myCEA = ce.CEA([s1, s2], if_paired=False) # double check to see if this is paired or not myCEA.show_CE_plane('CE Plane with cost vs utilities', x_label='Cost', y_label='Utilities', show_legend=True, show_clouds=True, figure_size=6) #look at class material to see how simulation parameters might have been used to form a cloud # ICER table print('') # return none and write result into csv #print(myCEA.build_CE_table(ce.Interval.PREDICTION)) #print(myCEA.build_CE_table())
s_center[3, 1] + np.random.normal(0, 200, 10)) s4 = ce.Strategy("s5", s_center[4, 0] + np.random.normal(0, 200, 10), s_center[4, 1] + np.random.normal(0, 200, 10)) s5 = ce.Strategy("s6", s_center[5, 0] + np.random.normal(0, 200, 10), s_center[5, 1] + np.random.normal(0, 200, 10)) s6 = ce.Strategy("s7", s_center[6, 0] + np.random.normal(0, 200, 10), s_center[6, 1] + np.random.normal(0, 200, 10)) s7 = ce.Strategy("s8", s_center[7, 0] + np.random.normal(0, 200, 10), s_center[7, 1] + np.random.normal(0, 200, 10)) s8 = ce.Strategy("s9", s_center[8, 0] + np.random.normal(0, 200, 10), s_center[8, 1] + np.random.normal(0, 200, 10)) s9 = ce.Strategy("s10", s_center[9, 0] + np.random.normal(0, 200, 10), s_center[9, 1] + np.random.normal(0, 200, 10)) # create a CEA object -- unpaired myCEA = ce.CEA([s0, s1, s2, s3, s4, s5, s6, s7, s8, s9], if_paired=False) # plot with label and sample cloud myCEA.show_CE_plane('CE plane with unpaired observations and showing labels', 'E[Effect]', 'E[Cost]', show_names=True, show_clouds=True, figure_size=6) # plot with label and sample cloud myCEA.show_CE_plane('CE plane with unpaired observations and showing labels', 'E[Effect]', 'E[Cost]', show_names=True, show_clouds=True,
from SimPy import EconEvalClasses as EV S0 = EV.Strategy(name='Base', cost_obs=[100], effect_obs=[1]) S1 = EV.Strategy(name='A1', cost_obs=[800], effect_obs=[0.5]) S2 = EV.Strategy(name='A2', cost_obs=[2000], effect_obs=[10]) S3 = EV.Strategy(name='A3', cost_obs=[500], effect_obs=[7]) S4 = EV.Strategy(name='A4', cost_obs=[-100], effect_obs=[2]) cea = EV.CEA(strategies=[S0, S1, S2, S3, S4], if_paired=False, health_measure=EV.HealthMeasure.UTILITY) print('On frontier') for s in cea.get_strategies_on_frontier(): print(s.name) print('Not on frontier') for s in cea.get_strategies_not_on_frontier(): print(s.name) cea.show_CE_plane('CE plane', 'E[Effect]', 'E[Cost]', show_names=True, figure_size=6) cea.build_CE_table(cost_digits=0, interval_type='n')
alpha=0.05 # summary statistics for all conditions print('Summary Stats OS Cost', simulation.get_sumStat_OS_cost().get_mean()) print('95% Confidence Interval for OS Cost', simulation.get_sumStat_OS_cost().get_t_CI(alpha)) print('Summary Stats No OS Cost', simulation.get_sumStat_NoOS_cost().get_mean()) print('95% Confidence Interval for No OS Cost', simulation.get_sumStat_NoOS_cost().get_t_CI(alpha)) print('Summary Stats OS Utility', simulation.get_sumStat_OS_utility().get_mean()) print('95% Confidence Interval for OS Utility', simulation.get_sumStat_OS_utility().get_t_CI(alpha)) print('Summary Stats No OS Utility', simulation.get_sumStat_NoOS_utility().get_mean()) print('95% Confidence Interval for No OS Utility', simulation.get_sumStat_NoOS_utility().get_t_CI(alpha)) print(" ") print (" ") # CEA plot # currently turning out weird but hopefully will have more of a 'cloud' when we randomize the simulation parameters s1 = ce.Strategy('Intervention', cost_obs=simulation.get_OS_costs(), effect_obs=simulation.get_OS_utilities()) s2 = ce.Strategy('No Intervention', cost_obs=simulation.get_NoOS_costs(), effect_obs=simulation.get_NoOS_utilities()) myCEA = ce.CEA([s2, s1], if_paired=False) myCEA.show_CE_plane('CE Plane with cost vs utilities, Bonanza', x_label='Utilities', y_label='Costs', show_legend=True, show_clouds=True, figure_size=6) # ICER table print('') # return none and write result into csv print(myCEA.build_CE_table(ce.Interval.PREDICTION)) print(myCEA.build_CE_table())
np.random.seed(seed=1) S0 = EV.Strategy(name='Base', cost_obs=np.random.normal(loc=100, scale=10, size=100), effect_obs=np.random.normal(loc=1, scale=.2, size=100)) S1 = EV.Strategy(name='A1', cost_obs=np.random.normal(loc=800, scale=50, size=100), effect_obs=np.random.normal(loc=0.5, scale=0.1, size=100)) S2 = EV.Strategy(name='A2', cost_obs=np.random.normal(loc=2000, scale=200, size=100), effect_obs=np.random.normal(loc=10, scale=1, size=100)) S3 = EV.Strategy(name='A3', cost_obs=np.random.normal(loc=500, scale=50, size=100), effect_obs=np.random.normal(loc=7, scale=1, size=100)) S4 = EV.Strategy(name='A4', cost_obs=np.random.normal(loc=-100, scale=10, size=100), effect_obs=np.random.normal(loc=2, scale=0.1, size=100)) cea = EV.CEA(strategies=[S0, S1, S2, S3, S4], if_paired=False, health_measure='u') print('On frontier') for s in cea.get_strategies_on_frontier(): print(s.name) print('Not on frontier') for s in cea.get_strategies_not_on_frontier(): print(s.name) cea.show_CE_plane('CE plane', 'E[Effect]', 'E[Cost]', show_names=False, show_clouds=True, figure_size=6) cea.build_CE_table(cost_digits=1, interval_type='c')