Case Study - Markov Simple
The decision trees are enough to answer some research questions. However, a more complicated Markov Model may be needed to represent the health condition accurately.
In our decision tree, we have a one time screening and calculations for if someone gets sick. However, what if:
There are a small percentage of people that can get sick again
The data does not exist for “Life Years Gained”.
A Markov Model will allow us to cleanly integrate this into our model.
Although we are calling this the “Simple Markov Model”, we understand that this is a really long case study, there will also be time to work on it tomorrow but we wanted to make sure that you had all the information for your model
Anatomy of a Markov Model in Amua: 
More Background on Disease X: After the initial treatment has happened at 50 years old, it cannot be repeated. The small percentage of individuals that get sick again will just get the palliative care that is currently provided. They will not be able to heal but will remain sick until death. Both all-cause deaths and disease deaths will be in the death state.
NOTE: For simplicity, we will be dropping the screening strategy from the exercise. A version with screening will be added for reviewing.
Use Bubble Diagram Tool
We will keep the decision tree for the one time treatment. The Markov Model will capture individuals healing, getting sick again, and dying.
More assistance with step
A: Add the Health States
In the Bubble Diagram tool:
- Type the name of the state into the “State Name” text box on the left side bar.
- Click “Add State”
3. Repeat for all the states
You should get:

B: Define the Transitions
You need to select where transitions between states are possible. This also includes the ability to return to a current state.
- On the main screen you should see the transition matrix

- Click on the box (
) within the cell to allow a transition between the two states
3. Repeat for all possible transitions.
C: Generate the Model
Once you have added all the possible transitions. Click the “Generate Diagram” Button on the left side bar (you may need to scroll down to see the button).

Then click to the “Bubble Diagram” tab to see your diagram
Note: You can download your diagram from the “Bubble Diagram” tab. You do not need to for this model but you will for your capstone if you are doing a Markov Model.
Check your Bubble Diagram

Building the model
In the Disease X model, we will be flowing the tree into the Markov model.
Click Model > New > Markov Model

You should get a empty page with a decision node (
)
More assistance with step
A: Add Markov Chain
Add the Markov Chain (
) for the “Treat None” arm.Option 1: Select the decision node. Right click > Add > Markov Chain.
Option 2: Select the decision node and click the Markov Chain button (
) in the top bar

2. Name that chain “Treat None”
B: Add the Health States
This model has three health states: Healthy, Sick, and Dead
Select the Markov chain labeled “Treat None”

Add the health states
Option 1: Right click > Add > Markov State (
).Option 2: Click the Markov State button (
) in the top bar.Option 3: Double click on the Markov Chain to get two Markov states added

Rename the State to “Healthy”
Repeat for Sick and Dead

C: Add events within each health state
- Identify the Events in each state
- Healthy: Stay Healthy, Get Sick, All-cause death
- Sick: Stay sick, Disease Death, All-cause death
- Dead: Remain Dead
- Select the Markov State labeled “Healthy”. It will outline red when selected

Add a chance node
Option 1: Right click > Add > Chance Node (
).Option 2: Click the Chance Node button (
) in the top barOption 3: Double click on the Markov State to get two chance nodes added

Change the labels to “Survive” and “Die”.
Nothing can happen after you die so we will change that to a state transition node. Select the “Die” branch and click the “Change to State Transition” ((
.) button on the top bar. You should get something like this. [It may have auto filled a state or it may also be blank]

- Click on the drop down arrow that is to the right of the state transition blue arrow to set the state transition.

- Select the correct state for that decision branch from the drop down. For “Die”, it should be “Dead”

Now let’s look back at the “Survive” branch. The proportion of the cohort that survives death, will have the chance of getting sick.
- Add a chance node for getting sick.

- At the end of each branch, change the chance nodes to state transitions.

- Update the state transitions to match the transition for that branch.

- Build out the events for the other two health states.
[Don’t worry about the Treat strategy, we will come back to it]
Check your Model

Add Parameters
To help with time, we have created a parameters file you can upload to your model.
On the top bar click Model > Import
An pop-up should appear to help “Import Objects”

Select the CSV source

Click the “Browse” button
Select the parameter file and click “Open”
Make sure the “Object Type” is set to “Parameters” and click “Import C…”
You’re side bar should now be populated with the model parameters
Here are the parameters if you need to add them manually:
| Name | Expression | Description |
|---|---|---|
| prev | 0.08 | Prevelance of Disease X at age 50 |
| p_sick | 0.03 | Annual probability of getting Disease X |
| p_diseasedeath | 0.15 | Annual probability of dying from Disease X |
| hr_treated | 0.5 | Hazard ratio of getting Disease X after treated |
| initial_age | 50 | Initial Age |
| c_treatment | 30000 | Cost of Treatment |
| c_pall | 15000 | Cost of Palliative Care |
Starting Probabilities
For a Markov Model, you have to determine where people start. Some models everyone starts in the same state and in other models people start spread out across multiple states.
In the “Treat None” branch, we know that some people will start sick and some will be healthy.
The current prevalence of Disease X in 50 year olds is 8%.
More assistance with step
The grey “p” before the bubble is the starting probability

Click the “0” right after the starting probability for the “Sick” state
Set the starting probability to “prev”

Leave the starting probability of death at 0. And the starting probability of Healthy to be “C” [the complimentary probability to Sick]
Check your Model

Uploading a Table
You may have noticed that there is no probability of death in the uploaded parameters. Parameters are set values that do not change over time. However, the probability of death increases with age. To accommodate this, we will upload a table and create a p_die variable.
More assistance with step
A: Add a table:
- Click to the “
Tables” tab on the right sidebar

Click on the blue plus sign

The “Define Table” pop-up will open

Add a name for your table. (Example: tbl_p_die)
There are two ways to add the table value from the downloaded CSV:
Click the “
Import” button on the top bar of the pop-upSelect the downloaded table from where you saved it.
Click Import
Open the downloaded table in a spreadsheet software (Example: Excel)
Select and copy the entire table
Click the paste (
) button on the top bar of the pop-up
Ensure that your table has no extra columns or rows. If it does, select and delete them with the remove (
) options on the top bar of the pop-upChoose the “Table Type” and “Look Up” Method. We will be using Lookup, Interpolate.
This means that for age 1 = 0.013 and age 2 =0.010 but if the model asks for age 1.5, it will return a number between the two
More information on table types: https://github.com/zward/Amua/wiki/Tables#table-types
Save your table

B: Create a p_die variable
- Click to the “
Variables” tab on the right sidebar

- Click on the blue plus sign
. The “Define Variable” pop-up will open

Name the variable “p_die”
Use the following formula to define the variable
tbl_p_die[initial_age + t, 1]

Note: We use “initial_age +t” for the row value because “t” alone is just the Amua built in variable for the cycle number. If we used just “t” the p_die for cycle 10 would be for 10 year olds not 60 year olds.
- Save the variable
Set Termination Condition
In a Markov model you have to define a horizon for the model to run. In Amua this is the termination condition. Since this is a lifetime model, running it to 110 years old or 60 more years is probably enough.
Remember that “t” is a built in cycle variable. Therefore, the termination condition can be set to end when t equals 60.
More assistance with step
- Below the Markov Chain is the termination condition

- Click on the [termination] and delete the text. Input
t==60
Parameterize the Model
Check your Model

Create the Treat All Branch
Once your model matches the one in the drop-down above, you can move on to the Treat All Branch
- Add a “Treat All” branch from the decision node

Copy and Paste in Amua
Copy and paste the “Treat None for the”Sick -> Treat” and “Not Sick -> Treat” arm.
Select the item you want to copy. In this case it is the “Treat None” arm of the model.
Right click and copy or use Ctrl + C [On Mac, CMD + C]
Select the Treat All Node
Right click and paste or use Ctrl + P [On Mac, CMD + P]
Click the “OCD” button to clean up the model
Rename the branch to “Sick -> Treat”
Repeat for “Not Sick -> Treat”
Check your Model

Adjusting to match strategy
Copy and pasting the strategy helped us save time but we need to make sure that the model accurately matches the strategy that it is running for.
Things that need fixed:
Set probability of sick or not sick in the tree part of “Treat All”
Set initial probabilities to match the corresponding branch
Add in treatment costs
Add in a rate reduction of getting sick again and needing palliative care
More assistance with step
A: Set probability of sick or not sick
In the tree portion of the “Treat All” branch, set the probability of sick to prev and the probability of not sick to “C”

B: Set initial probabilities
We will assume that after you get treatment that will remain healthy for atleast one cycle before getting sick again. Therefore the initial probabilities for both “Sick -> Treat” and “Not Sick -> Treat” are Healthy = 1, Sick = 0, and Dead = 0.

C: Add Treatment Cost
The needs to be a one-time cost added to the “Treat All” branch.
Option 1: Right click the “Treat All” branch and select “$ Add Cost (One-Time Event)”
Option 2: Select the “Treat All” branch and select the $ on the top banner
Update the cost to have the cost of treatment

D: Add reduction in p_sick for those treated
In both the “Sick -> Treat” and “Not Sick -> Treat” branches. Change the p_sick to p_sick*hr_treated.

Check your Model
| Strategy | Cost ($ for 1000 people) | LY (for 1000 people) |
|---|---|---|
| Treat None | 52566078.65 | 21336.7046 |
| Treat All | 59822033.62 | 26239.1531 |
Define Cycle Adjustments and Discounting
- Go to Model > Properties > select the Markov tab.
- Select the “Half-Cycle Correction” option.
- Select the “Discount Rewards” option and enter the discount rates (3%) for cost and LY
- Click “OK”
Get individual cost and LY
It is often easier to understand the impact of the different strategies when they are at an individual level.
- Go to Model > Properties > select the Simulation tab.
- Set Cohort Size to 1
Check your answer:
Run a CEA on a cohort size of 1 with Treat None as the basecase and a WTP of $100,000/LY
Enter your result:
What is the ICER (to two decimal places) of the strategy you would choose?
