QALY and Cost with Markov Model

    Let's work through a real example so you can see how this fits together. Picture a group of 100,000 people. Over time, each person moves between four health states: Well, Recurrence, Dead, and Dying by disease. We want two answers about this group. First, how long do they live on average? Second, how much does their care cost on average?

    To answer that, we need to know how people move from one state to the next in each cycle. Those chances are called transition probabilities. For example, a person who is Well this year might stay Well next year, or slip into Recurrence. We set up all of those chances as shown below.

    Four-state transition diagram for the QALY and Cost example: Well, Recurrence, Dying by disease, and Dead, with all between-state transition probabilities labelled.
    Four-state transition diagram for the QALY and Cost example: Well, Recurrence, Dying by disease, and Dead, with all between-state transition probabilities labelled.

    Next we need the payoffs for each state. Every year a person spends in the Well state or the Recurrence state counts as 1 life year gained. A year in Well costs $350. A year in Recurrence costs $3,190. Dying by disease costs $1,400. The Dead state has no cost at all.

    Now we have the states, the transition probabilities, and the payoffs. That is everything the model needs to work out the life expectancy of this group and its expected cost. To get started, open Rational Will or SpiceLogic Decision Tree and click the Markov Model button.

    Decision Tree Analyzer start page used to launch the Markov Model wizard for the QALY and Cost cohort example.
    Decision Tree Analyzer start page used to launch the Markov Model wizard for the QALY and Cost cohort example.

    Step 1: Specifying the states

    When you click the Markov Model button, a wizard opens. It walks you through the setup one screen at a time, so you never have to guess what comes next. On the first screen, add the four states from our example: Well, Recurrence, Dying by disease, and Dead. The screen below shows all four added.

    Markov wizard step 1 with all four states (Well, Recurrence, Dying by disease, Dead) added for the QALY and Cost analysis.
    Markov wizard step 1 with all four states (Well, Recurrence, Dying by disease, Dead) added for the QALY and Cost analysis.

    Now click Proceed. The next screen asks whether any state has an action you can take from it. In this example there are no decisions to make. The group just moves between health states on its own. So answer No and click Proceed again.

    Wizard prompt 'Your control in a State' asking whether the user's actions can influence the probability of transitioning from the Well state, with Yes / No / Back / Cancel buttons.
    Wizard prompt 'Your control in a State' asking whether the user's actions can influence the probability of transitioning from the Well state, with Yes / No / Back / Cancel buttons.

    Step 2: Configuring the cohort simulation settings

    The wizard now asks you to set the simulation settings for the Markov process. Match the settings shown below. The one that matters most is the maximum number of state iterations. Set it to 55. Each iteration is one cycle, which here is one year. So 55 iterations runs the group forward for 55 years. That is long enough for almost everyone to reach the Dead state and for the numbers to settle down.

    Markov cohort simulation settings in the wizard with the maximum number of state iterations set to 55 for the QALY and Cost example.
    Markov cohort simulation settings in the wizard with the maximum number of state iterations set to 55 for the QALY and Cost example.

    Step 3: Setting up the transition probabilities

    Click Proceed and the wizard asks for the transition probabilities. These are the chances of moving from one state to another in a single cycle. Start with the Well state. Set the chance of staying in Well, and the chances of moving to each of the other states, exactly as shown below. The probabilities for one state always add up to 1, so if they do not, check your numbers before moving on. When you are done, click Proceed.

    Transition probability editor for the Well state with probabilities entered for transitions to Recurrence, Dying by disease, and Dead.
    Transition probability editor for the Well state with probabilities entered for transitions to Recurrence, Dying by disease, and Dead.

    The next screen asks for the transition probabilities of another state, the Recurrence state. Fill them in as shown below.

    Transition probability editor for the Recurrence state, configuring the probabilities of moving to the other three states in the next cycle.
    Transition probability editor for the Recurrence state, configuring the probabilities of moving to the other three states in the next cycle.

    Click Proceed. Now the wizard asks for the transition probabilities of the Dying by disease state. Set them as shown, then click Proceed again.

    Transition probability editor for the Dying by disease state, defining the probability of progressing to Dead versus remaining in the same state.
    Transition probability editor for the Dying by disease state, defining the probability of progressing to Dead versus remaining in the same state.

    Finally, mark the Dead state as an absorbing state. An absorbing state is one nobody ever leaves. Once a person is dead, they stay dead for the rest of the simulation. Marking it tells the model that no transitions lead out of this state. Then click Proceed.

    Dead state marked as an absorbing state so once the cohort enters Dead it cannot transition out, closing out the simulation for that fraction.
    Dead state marked as an absorbing state so once the cohort enters Dead it cannot transition out, closing out the simulation for that fraction.

    Step 4: Specifying the initial state

    The wizard now takes you to a screen where you pick the starting state. This is the state everyone in the group begins in. For this example, choose Well as the initial state, since all 100,000 people start out healthy.

    Initial-state step of the wizard with the Well state selected as the certain starting state for the cohort.
    Initial-state step of the wizard with the Well state selected as the certain starting state for the cohort.

    Step 5: Setting the payoff

    Now it is time to tell the model what each state is worth, both in life years and in cost. On the next screen, click Yes to start setting the payoffs.

    Wizard prompt for adding payoffs to the states, answered Yes so cost and life-year payoffs can be configured next.
    Wizard prompt for adding payoffs to the states, answered Yes so cost and life-year payoffs can be configured next.

    On the screen that follows, click the Cost-Effectiveness Analysis in Healthcare button. This tells the model you want to track two things side by side: how effective each state is, measured in life years, and how much it costs.

    Criteria type selection step with the 'Cost-Effectiveness Analysis in Healthcare' button highlighted as the payoff framework for this Markov model.
    Criteria type selection step with the 'Cost-Effectiveness Analysis in Healthcare' button highlighted as the payoff framework for this Markov model.

    Next, set the effectiveness criterion as shown below. This is the benefit we care about, the life years gained.

    Effectiveness criterion configuration with Life-years selected as the effectiveness measure used to compute expected life-years for the cohort.
    Effectiveness criterion configuration with Life-years selected as the effectiveness measure used to compute expected life-years for the cohort.

    Now click the Cost tab at the top and check the box as shown below. This turns on cost tracking alongside the effectiveness you just set.

    Cost Criterion tab with the Minimize Cost checkbox enabled, Unit $, Minimum Possible Cost 0, Maximum Possible Cost 10000, and Maximum willing to pay per unit of effectiveness 50000.
    Cost Criterion tab with the Minimize Cost checkbox enabled, Unit $, Minimum Possible Cost 0, Maximum Possible Cost 10000, and Maximum willing to pay per unit of effectiveness 50000.

    Click Proceed. The wizard asks you to set the cost and effectiveness for the Well state. Set Life-years = 1, because each cycle spent in Well adds one life year. Set the cost to $350, the cost of one year in that state.

    Payoff editor for the Well state with Life-years set to 1 and cost set to 350 dollars per cycle the cohort stays in Well.
    Payoff editor for the Well state with Life-years set to 1 and cost set to 350 dollars per cycle the cohort stays in Well.

    Click Proceed. For the Recurrence state, set 1 life year and a cost of $3,190, then click Proceed. For the Dying by disease state, set 0 life years and a cost of $1,400, then click Proceed. The Dead state has no cost and no life years, so there is nothing to enter. Just click the Skip setting reward for this state button.

    Reward step for the Dead state with the 'Skip getting a reward for this state' button used, since no cost or effectiveness accrues in Dead.
    Reward step for the Dead state with the 'Skip getting a reward for this state' button used, since no cost or effectiveness accrues in Dead.

    As soon as you click that button, the wizard finishes and your model appears as a decision tree diagram.

    Step 6: Analyzing the result

    Now open the Markov Analyzer panel to see what the model worked out.

    Completed QALY and Cost Markov model shown as a decision tree diagram with the Markov Analyzer panel ready to inspect cohort results.
    Completed QALY and Cost Markov model shown as a decision tree diagram with the Markov Analyzer panel ready to inspect cohort results.

    To read the two answers we wanted, hover over the Markov chance node. Its tooltip shows the life expectancy and the expected cost for this group, as shown below.

    Tooltip on the Markov Chance node displaying the expected life-years and expected cost computed for the cohort across the simulation.
    Tooltip on the Markov Chance node displaying the expected life-years and expected cost computed for the cohort across the simulation.


    You can also open the charts to look at the Markov model from other angles. For example, you can see how the group spreads across the states over time, and how cost builds up cycle by cycle.

    Markov Analyzer charts window for the QALY and Cost model with probability traces, cumulative cost, and effectiveness charts across cycles.
    Markov Analyzer charts window for the QALY and Cost model with probability traces, cumulative cost, and effectiveness charts across cycles.

    Step 7: Modifying and refining the model

    Once the wizard is done, you are left with the decision tree showing the Markov process diagram. Nothing is locked in. You can go back and change the states, the transition probabilities, the rewards, or anything else, and the results update to match. Say a new study comes out with better survival numbers. Just update the transition probabilities and read the new life expectancy right away. To learn how to edit the diagram directly, see this page.

    Last updated on Jan 7, 2026