예제 #1
0
import ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov
import scr.SamplePathClasses as PathCls
import scr.FigureSupport as Figs

# create a cohort
cohort = MarkovCls.Cohort(id=0, therapy=P.Therapies.ANTICOAGULATION)

# simulate the cohort
simOutputs = cohort.simulate()

# print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs, 'Anticoagulation:')
예제 #2
0
import scr.SamplePathClasses as PathCls
import scr.FigureSupport as Figs

# create and cohort
cohort = MarkovCls.Cohort(id=0, therapy=P.Therapies.ANTICOAG)

simOutputs = cohort.simulate()

# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputs.get_survival_curve(),
                          title='Survival curve',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

# graph histogram of survival times
Figs.graph_histogram(data=simOutputs.get_survival_times(),
                     title='Survival times of patients with Stroke',
                     x_label='Survival time (years)',
                     y_label='Counts',
                     bin_width=1)

# graph histogram of number of strokes
Figs.graph_histogram(data=simOutputs.get_if_developed_stroke(),
                     title='Number of Strokes per Patient',
                     x_label='Strokes',
                     y_label='Counts',
                     bin_width=1)

# print outcomes (means and CIs)
SupportMarkov.print_outcomes(simOutputs, 'No treatment:')
예제 #3
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 17 13:49:10 2018

@author: Aslan
"""

###HOMEWORK QUESTION 3 and 4######

import ParameterClassesAA as P
import MarkovModelClassesAA as MarkovCls
import SupportMarkovModel as SupportMarkov
import SamplePathClasses as PathCls
import FigureSupport as Figs

SupportMarkov.report_CEA_CBA(simOutputs_NONE, simOutputs_ANTICOAG)
print("Please refer to the table for Question 3.")
print(
    "To answer Question 4, I'd recommend the anticoagulation drug at a WTP anywhere above $20,000ish."
)


cohort_notherapy = MarkovCls.Cohort(
    id=0,
    therapy=P.Therapies.NONE)
# simulate the cohort
simOutputs_NO = cohort_notherapy.simulate()

cohort_wafarin = MarkovCls.Cohort(
    id=1,
    therapy=P.Therapies.Warfarin)

cohort_aspirin = MarkovCls.Cohort(
    id=1,
    therapy=P.Therapies.Aspirin
)


# simulate the cohort
simOutputs_wafarin = cohort_wafarin.simulate()
simOutputs_aspirin = cohort_aspirin.simulate()

SupportMarkov.print_outcomes(simOutputs_NO, "No Therapy:")
SupportMarkov.print_outcomes(simOutputs_wafarin, "Wafarin Therapy:")
SupportMarkov.print_outcomes(simOutputs_aspirin, "Aspirin Therapy:")

# print comparative outcomes
SupportMarkov.print_comparative_outcomes(simOutputs_wafarin, simOutputs_NO)
SupportMarkov.print_comparative_outcomes(simOutputs_wafarin, simOutputs_aspirin)
예제 #5
0
import ParameterClasses as P
import MarkovModel as MarkovCls
import SupportMarkovModel as SupportMarkov
import scr.SamplePathClasses as PathCls
import scr.FigureSupport as Figs

# create and cohort
cohortNoTherapy = MarkovCls.Cohort(
    id=0,
    therapy=P.Therapies.NONE)

simOutputs_none = cohortNoTherapy.simulate()


# create and cohort
cohortAnticoagTherapy = MarkovCls.Cohort(
    id=1,
    therapy=P.Therapies.ANTICOAG)

simOutputs_anticoag = cohortAnticoagTherapy.simulate()

SupportMarkov.print_comparative_outcomes(simOutputs_none, simOutputs_anticoag)
import ParameterClasses as P
import MarkovModel as MarkovCls
import SupportMarkovModel as SupportMarkov

# create a cohort for ultrasound
cohort = MarkovCls.Cohort(id=0, screening=P.Screening.US)

simOutputs = cohort.simulate()

# print outcomes (means and CIs)
SupportMarkov.print_outcomes(simOutputs, 'Ultrasound:')
예제 #7
0
import MarkovModelClasses as MarkovCls
import ParameterClasses as ParameterCls
import SupportMarkovModel as SupportModel
import scr.SamplePathClasses as PathCls
import scr.FigureSupport as Figs

# create the cohorts
cohort_anticoagulant = MarkovCls.Cohort(
    id=0, therapy=ParameterCls.Therapies.ANTICOAGULANT)
cohort_no_therapy = MarkovCls.Cohort(id=0,
                                     therapy=ParameterCls.Therapies.NO_THERAPY)

# simulate the cohorts
simOutputs_anticoagulant = cohort_anticoagulant.simulate()
simOutputs_no_therapy = cohort_no_therapy.simulate()

# Question 3
SupportModel.print_outcomes(simOutputs_no_therapy, 'No therapy')
import HW9.ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov
import scr.SamplePathClass as PathCls
import scr.FigureSupport as Figs

# look at outcomes for both non-treatment (mono) and treatment (anticoagulation) scenarios

# create a cohort1 for mono therapy
cohort1 = MarkovCls.Cohort(id=0, therapy=P.Therapies.MONO)
# simulate the cohort
simOutputs1 = cohort1.simulate()

# create a cohort2 for anticoagulation therapy
cohort2 = MarkovCls.Cohort(id=1, therapy=P.Therapies.ANTICOAG)
# simulate the cohort
simOutputs2 = cohort2.simulate()

# problem 1- print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs1, 'No treatment scenario:')
SupportMarkov.print_outcomes(simOutputs2, 'Treatment scenario:')

# problem 2- expected increase in total costs and total utilities
SupportMarkov.print_comparative_outcomes(simOutputs1, simOutputs2)

#problem 3- cost benefit analysis
SupportMarkov.report_CEA_CBA(simOutputs1, simOutputs2)
예제 #9
0
import ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov

# simulating mono therapy
# create a cohort
cohort_none = MarkovCls.Cohort(id=0, therapy=P.Therapies.NONE)
# simulate the cohort
simOutputs_none = cohort_none.simulate()

# simulating combination therapy
# create a cohort
cohort_treat = MarkovCls.Cohort(id=0, therapy=P.Therapies.TREAT)
# simulate the cohort
simOutputs_treat = cohort_treat.simulate()

# print the estimates for the mean survival time and mean time to AIDS
SupportMarkov.print_outcomes(simOutputs_none, "No Therapy:")
SupportMarkov.print_outcomes(simOutputs_treat, "Anticoagulant Therapy:")

# print comparative outcomes
SupportMarkov.print_comparative_outcomes(simOutputs_none, simOutputs_treat)
예제 #10
0
# simulating PCT
# create a cohort
cohort_PCT = MarkovCls.Cohort(
    id=0,
    pop_size=2000,
    therapy=P.Therapies.PCT)
# simulate the cohort
simOutputs_PCT = cohort_PCT.simulate()

# simulating antibiotics
# create a cohort
cohort_antibiotics = MarkovCls.Cohort(
    id=1,
    pop_size=2000,
    therapy=P.Therapies.ANTIBIOTICS)
# simulate the cohort
simOutputs_antibiotics = cohort_antibiotics.simulate()

# draw survival curves and histograms
SupportMarkov.draw_survival_curves_and_histograms(simOutputs_antibiotics, simOutputs_PCT)

# print the estimates for the mean survival time and mean time to AIDS
SupportMarkov.print_outcomes(simOutputs_antibiotics, "Standard treatment:")
SupportMarkov.print_outcomes(simOutputs_PCT, "PCT:")

# print comparative outcomes
SupportMarkov.print_comparative_outcomes(simOutputs_antibiotics, simOutputs_PCT)

# report the CEA results
SupportMarkov.report_CEA_CBA(simOutputs_antibiotics, simOutputs_PCT)
예제 #11
0
import ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov

# create a cohort
cohort = MarkovCls.Cohort(id=0, therapy=P.Therapies.TREAT)

# simulate the cohort
simOutputs = cohort.simulate()

# print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs, 'AntiCoagulant:')
예제 #12
0
# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputs.get_survival_curve(),
                          title='Survival curve',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

# graph histogram of survival times
Figs.graph_histogram(data=simOutputs.get_survival_times(),
                     title='Survival times of patients with Stroke',
                     x_label='Survival time (years)',
                     y_label='Counts',
                     bin_width=1)

# print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs, 'Without therapy:')

########################################################
# create a cohort with treatment
cohortwith = MarkovCls.Cohort(id=0, therapy=P.Therapies.WITH)

# simulate the cohort
simOutputswith = cohortwith.simulate()

# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputswith.get_survival_curve(),
                          title='Survival curve with Treatment',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

# graph histogram of survival times
예제 #13
0
import ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov
import scr.SamplePathClasses as PathCls
import scr.FigureSupport as Figs

# create a cohort
cohort = MarkovCls.Cohort(id=0, therapy=P.Therapies.COMBO)

simOutputsTreat = cohort.simulate_treatment()

# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputsTreat.get_survival_curve(),
                          title='Survival curve',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

# graph histogram of survival times
Figs.graph_histogram(data=simOutputsTreat.get_survival_times(),
                     title='Survival times of patients with HIV',
                     x_label='Survival time (years)',
                     y_label='Counts',
                     bin_width=1)

# print the outcomes of cohort with therapy
SupportMarkov.print_outcomes(simOutputsTreat, 'Combo therapy:')
예제 #14
0
import ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov

# simulating no therapy
# create a cohort
cohort_none = MarkovCls.Cohort(id=0, therapy=P.Therapies.NONE)
# simulate the cohort
simOutputs_none = cohort_none.simulate()

# simulating statin therapy
# create a cohort
cohort_statin = MarkovCls.Cohort(id=1, therapy=P.Therapies.STATIN)
# simulate the cohort
simOutputs_statin = cohort_statin.simulate()

# draw survival curves and histograms
SupportMarkov.draw_survival_curves_and_histograms(simOutputs_none,
                                                  simOutputs_statin)

# print the estimates for the mean survival time and mean time to cardiac death
SupportMarkov.print_outcomes(simOutputs_none, "No Therapy:")
SupportMarkov.print_outcomes(simOutputs_statin, "Statin Therapy:")

# print comparative outcomes
SupportMarkov.print_comparative_outcomes(simOutputs_none, simOutputs_statin)

# report the CEA results
SupportMarkov.report_CEA_CBA(simOutputs_none, simOutputs_statin)
예제 #15
0
import scr.SamplePathClasses as PathCls
import scr.FigureSupport as Figs

#Problem 3: Simulation (Weight 4): Use Monte Carlo to simulate patients for 15 years (from age 65 to 80).
# To evaluate these continuous-time Markov models, we need to convert them to discrete-time Markov models.
# Find an appropriate cycle length to simulate these discrete-time Markov models.

# simulating no therapy
# create a cohort
cohort_no = MarkovCls.Cohort(id=0, therapy=P.Therapies.NONE)
# simulate the cohort
simOutputs_no = cohort_no.simulate()

# simulating anticoagulation therapy
# create a cohort
cohort_ANTICOAG = MarkovCls.Cohort(id=1, therapy=P.Therapies.ANTICOAG)
# simulate the cohort
simOutputs_ANTICOAG = cohort_ANTICOAG.simulate()

SupportMarkov.print_outcomes(simOutputs_no, "No Drug:")
SupportMarkov.print_outcomes(simOutputs_ANTICOAG, "Anticoagulation:")

# print comparative outcomes
print("Problem 2")
SupportMarkov.print_comparative_outcomes(simOutputs_no, simOutputs_ANTICOAG)

#Problem 5: Economic Evaluation (Weight 2): Perform economic evaluation using cost-utility analysis
# with discount rate 3%.
# report the CEA results
SupportMarkov.report_CEA_CBA(simOutputs_no, simOutputs_ANTICOAG)
예제 #16
0
import ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov
import scr.SamplePathClasses as PathCls
import scr.FigureSupport as Figs

# create a cohort
cohort = MarkovCls.Cohort(id=0, therapy=P.Therapies.NONE)

# simulate the cohort
simOutputs = cohort.simulate()

# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputs.get_survival_curve(),
                          title='Survival curve',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

# graph histogram of survival times
Figs.graph_histogram(data=simOutputs.get_survival_times(),
                     title='Survival times of patients starting in "well"',
                     x_label='Survival time (years)',
                     y_label='Counts',
                     bin_width=1)

# print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs, 'without therapy')
예제 #17
0
#Perform economic evaluation using cost-utility analysis with discount rate 3%. Assume that:
#- The utility of being in state “Well” is 1, in state “Stroke” is 0.2, and in state “Post-Stroke”
# is 0.9.
#- The annual cost of being in “Post-Stroke” is $200 and when anticoagulation is used, this cost
#increases to $750.
#- Stoke results in a one-time cost of $5,000.
# Note: Since the cycle length for this problem will be quite small, we don’t need to
#  perform half-cycle correction.

import ParameterClasses as P
import MarkovModel as MarkovCls
import SupportMarkovModel as SupportMarkov

# create and cohort
cohort_anticoag = MarkovCls.Cohort(
    id=1,
    therapy=P.Therapies.ANTICOAG)

simOutputs_anticoag = cohort_anticoag.simulate()

cohort_none = MarkovCls.Cohort(
    id=0,
    therapy=P.Therapies.NONE)

simOutputs_none = cohort_none.simulate()


SupportMarkov.report_CEA_CBA(simOutputs_none=simOutputs_none, simOutputs_anticoag=simOutputs_anticoag)
예제 #18
0
cohort_warfarin = MarkovCls.Cohort(id=1, therapy=P.Therapies.WARFARIN)
# simulate cohort
simOutputs_warfarin = cohort_warfarin.simulate()

# create and simulate cohort for dabigatran_110
cohort_dabigatran_110 = MarkovCls.Cohort(id=2,
                                         therapy=P.Therapies.DABIGATRAN_110MG)
simOutputs_dabigatran_110 = cohort_dabigatran_110.simulate()

# create and simulate cohort dabigatran_150
cohort_dabigatran_150 = MarkovCls.Cohort(id=3,
                                         therapy=P.Therapies.DABIGATRAN_150MG)
simOutputs_dabigatran_150 = cohort_dabigatran_150.simulate()

SupportMarkov.draw_survival_curves_and_histograms(
    simOutputs_warfarin=simOutputs_warfarin,
    simOutputs_dabigatran_110=simOutputs_dabigatran_110,
    simOutputs_dabigatran_150=simOutputs_dabigatran_150)

SupportMarkov.print_outcomes(simOutputs_warfarin, "Warfarin")
SupportMarkov.print_outcomes(simOutputs_dabigatran_110, "Dabigatran 110mg")
SupportMarkov.print_outcomes(simOutputs_dabigatran_150, "Dabigatran 150mg")

print('Warfarin vs. Dabigatran 110mg')
SupportMarkov.print_comparative_outcomes(simOutputs_warfarin,
                                         simOutputs_dabigatran_110)

print('Warfarin vs. Dabigatran 150mg')
SupportMarkov.print_comparative_outcomes(simOutputs_warfarin,
                                         simOutputs_dabigatran_150)

print('Dabigatran 110mg vs. Dabigatran 150mg')
예제 #19
0
    x_label='Survival time (years)',
    y_label='Counts',
    bin_width=0.5
)

# graph histogram of number of strokes
Figs.graph_histogram(
    data=warfarin_simOutputs.get_if_developed_stroke(),
    title='Number of Strokes per Patient, Warfarin',
    x_label='Strokes',
    y_label='Counts',
    bin_width=1
)

# print outcomes (means and CIs)
SupportMarkov.print_outcomes(warfarin_simOutputs, 'Warfarin:')


# create and simulate cohort for dabigatran 110mg

dabigatran_110_cohort = MarkovCls.Cohort(
    id=2,
    therapy=P.Therapies.DABIGATRAN_110MG)

dabigatran_110_simOutputs = dabigatran_110_cohort.simulate()

# graph survival curve
PathCls.graph_sample_path(
    sample_path=dabigatran_110_simOutputs.get_survival_curve(),
    title='Survival curve, Dabigatran 110',
    x_label='Simulation time step',
예제 #20
0
import scr.FigureSupport as Figs

# create a cohort
cohort = MarkovCls.Cohort(id=0, therapy=P.Therapies.ANTI)

# simulate the cohort
simOutputs = cohort.simulate()

# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputs.get_survival_curve(),
                          title='Survival curve',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

# graph histogram of survival times
Figs.graph_histogram(data=simOutputs.get_survival_times(),
                     title='Survival times of WELL patients',
                     x_label='Survival time (years)',
                     y_label='Counts',
                     bin_width=1)

# graph histogram of survival times
Figs.graph_histogram(data=simOutputs.get_survival_times(),
                     title='Survival times of POST STROKE patients',
                     x_label='Survival time (years)',
                     y_label='Counts',
                     bin_width=1)

# print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs, 'Anticoagulent therapy:')
예제 #21
0
# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputs.get_survival_curve(),
                          title='Survival curve',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

# graph histogram of survival times
Figs.graph_histogram(data=simOutputs.get_survival_times(),
                     title='Survival times of patients with HIV',
                     x_label='Survival time (years)',
                     y_label='Counts',
                     bin_width=1)

# print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs, 'LDCT Screening:')

cohort_PLCO = MarkovCls.Cohort(id=1, therapy=P.Therapies.PLCO)

# simulate the cohort
simOutputs_PLCO = cohort_PLCO.simulate()

# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputs_PLCO.get_survival_curve(),
                          title='Survival curve',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

# graph histogram of survival times
Figs.graph_histogram(data=simOutputs_PLCO.get_survival_times(),
                     title='Survival times of patients with HIV',
예제 #22
0
# graph histogram of number of strokes
Figs.graph_histogram(
    data=simOutputs_no.get_nums_of_stroke(),
    title='Number of strokes a patient may experience without anti-coagulant',
    x_label='Number of strokes',
    y_label='Counts',
    bin_width=1
)

# graph histogram of number of strokes
Figs.graph_histogram(
    data=simOutputs_ac.get_nums_of_stroke(),
    title='Number of strokes a patient may experience with anti-coagulant',
    x_label='Number of strokes',
    y_label='Counts',
    bin_width=1
)

# print the outcomes of this simulated cohort
print('Problems 1 and 2: please see MarkovDiagrams.pdf')
print('   ')
print('Problems 3 and 7')
SupportMarkov.print_outcomes(simOutputs_no, 'No anti-coagulant:')
print('  ')
print('Problem 4: please see ParameterClasses.py, lines 76-90.')
print('   ')
print('Problem 6: please see graphs')
print('   ')
print('Problems 5 and 7')
SupportMarkov.print_outcomes(simOutputs_ac, 'Anti-coagulant:')
cohort_none = MarkovCls.Cohort(
    id=0,
    therapy=P.Therapies.NONE)
# simulate the cohort
simOutputs_none = cohort_none.simulate()

# ANTICOAGULANT
# create a cohort
cohort_anticoag = MarkovCls.Cohort(
    id=0,
    therapy=P.Therapies.ANTICOAG)
# simulate the cohort
simOutputs_anticoag = cohort_anticoag.simulate()

# draw survival curves and histograms
SupportMarkov.draw_survival_curves_and_histograms(simOutputs_none, simOutputs_anticoag)

print('Problem 1')
# print the estimates
SupportMarkov.print_outcomes(simOutputs_none, "No Anticoagulant:")
SupportMarkov.print_outcomes(simOutputs_anticoag, "Anticoagulant:")
print('   ')

# print comparative outcomes
print('Problem 2')
SupportMarkov.print_comparative_outcomes(simOutputs_none, simOutputs_anticoag)
print('  ')

# report the CEA results
print('Problems 3: please see CEATable and the CEA figure.')
SupportMarkov.report_CEA_CBA(simOutputs_none, simOutputs_anticoag)
예제 #24
0
import MarkovcClasses as MarkovClasses
import Parameters as Parameters
import SupportMarkovModel as Support
import scr.SamplePathClasses as PathClasses

# no drug
cohort1 = MarkovClasses.Cohort(id=1, therapy=Parameters.Therapies.no_drug)
simOutputs1 = cohort1.simulate()
Support.print_outcomes(simOutputs1, "No drug")

# drug treatment
cohort2 = MarkovClasses.Cohort(id=1, therapy=Parameters.Therapies.tx_drug)
simOutputs2 = cohort2.simulate()
Support.print_outcomes(simOutputs2, "Drug Treatment")

# survival curves
PathClasses.graph_sample_path(sample_path=simOutputs1.get_survival_curve(),
                              title='Survival curve (no drug)',
                              x_label='Simulation time step',
                              y_label='Number of alive individuals')

PathClasses.graph_sample_path(sample_path=simOutputs2.get_survival_curve(),
                              title='Survival curve (drug treatment)',
                              x_label='Simulation time step',
                              y_label='Number of alive individuals')
예제 #25
0
import scr.FigureSupport as Figs

# create a cohort
cohort = MarkovCls.Cohort(
    id=0,
    therapy=P.Therapies.MONO)

# simulate the cohort
simOutputs = cohort.simulate()

# graph survival curve
PathCls.graph_sample_path(
    sample_path=simOutputs.get_survival_curve(),
    title='Survival curve',
    x_label='Simulation time step',
    y_label='Number of alive patients'
    )

# graph histogram of survival times
Figs.graph_histogram(
    data=simOutputs.get_survival_times(),
    title='Survival times of patients with HIV',
    x_label='Survival time (years)',
    y_label='Counts',
    bin_width=1
)

# print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs, 'Mono therapy:')

예제 #26
0
# graph survival curve
PathCls.graph_sample_path(sample_path=simOutputs_NONE.get_survival_curve(),
                          title='Survival curve',
                          x_label='Simulation time step (no therapy)',
                          y_label='Number of alive patients')

PathCls.graph_sample_path(
    sample_path=simOutputs_ANTICOAG.get_survival_curve(),
    title='Survival curve',
    x_label='Simulation time step (anticoagulation therapy)',
    y_label='Number of alive patients')

# graph histogram of survival times
Figs.graph_histogram(
    data=simOutputs_NONE.get_survival_times(),
    title='Survival times of patients with Stroke (no therapy)',
    x_label='Survival time (years)',
    y_label='Counts',
    bin_width=1)

Figs.graph_histogram(
    data=simOutputs_ANTICOAG.get_survival_times(),
    title='Survival times of patients with Stroke (anticoagulation therapy)',
    x_label='Survival time (years)',
    y_label='Counts',
    bin_width=1)

# print the outcomes of this simulated cohort
SupportMarkov.print_outcomes(simOutputs_ANTICOAG, 'Anticoagulant therapy:')
예제 #27
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 17 13:39:58 2018

@author: Aslan
"""

###HOMEWORK QUESTION 2######

import ParameterClassesAA as P
import MarkovModelClassesAA as MarkovCls
import SupportMarkovModel as SupportMarkov
import SamplePathClasses as PathCls
import FigureSupport as Figs

# create none and cohort
a_cohort_without_therapy = MarkovCls.Cohort(id=0, therapy=P.Therapies.NONE)
simOutputs_NONE = a_cohort_without_therapy.simulate()

# create anti and cohort
a_cohort_with_anticoag_therapy = MarkovCls.Cohort(id=1,
                                                  therapy=P.Therapies.ANTICOAG)
simOutputs_ANTICOAG = a_cohort_with_anticoag_therapy.simulate()

###Grab it from SupportMarkov model.
SupportMarkov.print_comparative_outcomes(simOutputs_NONE, simOutputs_ANTICOAG)
예제 #28
0
import ParameterClassesTreatment as P
import MarkovModelTreatment as MarkovCls
import SupportMarkovModel as SupportMarkov
import scr.SamplePathClasses as PathCls
import scr.FigureSupport as Figs

#Create a cohort that receives anticoag therapy
cohort = MarkovCls.Cohort(id=0, therapy=P.Therapies.ANTICOAG)

#simulate cohort with anticoag therapy
simOutputs = cohort.simulate()

#Graph survival curve of those who receive anticoag therapy
PathCls.graph_sample_path(sample_path=simOutputs.get_survival_curve(),
                          title='Survival Curve of Those With Therapy',
                          x_label='Simulation time step',
                          y_label='Number of alive patients')

#Graph histogram of survival times of those with therapy
Figs.graph_histogram(data=simOutputs.get_survival_times(),
                     title='Survival times of patients with Therapy',
                     x_label='Survival Time (years)',
                     y_label='Counts',
                     bin_width=1)

#print the outcomes of the simulated cohort with therapy
SupportMarkov.print_outcomes(simOutputs, 'With Therapy')
예제 #29
0
import ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov

# simulating mono therapy
# create a cohort
cohort_mono = MarkovCls.Cohort(id=0, therapy=P.Therapies.MONO)
# simulate the cohort
simOutputs_mono = cohort_mono.simulate()

# simulating combination therapy
# create a cohort
cohort_combo = MarkovCls.Cohort(id=0, therapy=P.Therapies.COMBO)
# simulate the cohort
simOutputs_combo = cohort_combo.simulate()

# draw survival curves and histograms
SupportMarkov.draw_survival_curves_and_histograms(simOutputs_mono,
                                                  simOutputs_combo)

# print the estimates for the mean survival time and mean time to AIDS
SupportMarkov.print_outcomes(simOutputs_mono, "No Therapy:")
SupportMarkov.print_outcomes(simOutputs_combo, "Anticoagulation Therapy:")

# print comparative outcomes
SupportMarkov.print_comparative_outcomes(simOutputs_mono, simOutputs_combo)

# report the CEA results
SupportMarkov.report_CEA_CBA(simOutputs_mono, simOutputs_combo)
예제 #30
0
import ParameterClasses as P
import MarkovModelClasses as MarkovCls
import SupportMarkovModel as SupportMarkov

# simulating mono therapy
# create a cohort
cohort_none = MarkovCls.Cohort(id=0, therapy=P.Therapies.NONE)
# simulate the cohort
simOutputs_none = cohort_none.simulate()

# simulating combination therapy
# create a cohort
cohort_treat = MarkovCls.Cohort(id=0, therapy=P.Therapies.TREAT)
# simulate the cohort
simOutputs_treat = cohort_treat.simulate()

# print the estimates for the mean survival time and mean time to AIDS
SupportMarkov.print_outcomes2(simOutputs_none, "No Therapy:")
SupportMarkov.print_outcomes2(simOutputs_treat, "Anticoagulant Therapy:")