# Transition probabilities that are stage dependent and transition state dependent?

Dear All,

I am dealing with a transition state model. I have figured out how to assign transition probabilities depending on the stage. But I want to take the model to the next level.

I do not only want to assign stage-dependent probabilities, I want to implement a function that helps assign transition probabilities that are stage dependent and transition state dependent (e.g. for the first 3 years in a state, assign transition probability XYZ to a population)

To make this easier to understand, I would like to give an example: e.g. when an individual of population transitions from state A to state B, the likelihood to transition to stage C is e.g. 10 % transition probability in the first year/stage in state B, 5% transition probability in the second year/stage in state B and 3 % transition probability in the third year/stage in state B etc...... since I do not know at which year/stage an individual arrives at state B, I cannot use transition probabilities only dependent on years/stages.

Has anyone solved this problem? I would really appreciate your help!!!! Regards, Andreas

### Comments

1 comment
• Official comment

TreeAge Support assisted Andrea with this question but we wanted to respond with a solution in case other people had the same questions

You can address your problem by breaking it down. It seems the model needs to have probabilities which are dependent on:

1. Health State dependent (TreeAge key word: _state_index)

2. The amount of time in a Health State (tracker in Microsimulation or tunnels in Cohort Analysis)

For example, lets say moving from state A to state B is dependent on the amount of time you have spent in state A.

There are two options for you, depending on whether you are doing Expected Value or Cohort modelling, or Microsimulation.

Cohort models -  use _tunnels.

I recommend designating State A as a tunnel state and set the Tunnel Max for this state depending on the amount of time you care about being in a state. Lets assume we care about the first, second and third time in this state. And assume if you are in the state more than 3 times, you will use the same transition probability as the third time.

1. Select the branch for State A, open the Markov Info View and set the Tunnel Max to 3.

2. Create a table called table_Prob_AtoB with the following contents:

index  Value

1        0.1

2        0.05

3        0.03

3. Then create a variable which will get the correct probability depending on the health state and time through, such as prob_AToB = table_Prob_AtoB[ _tunnel ].

4. Use the probability in the appropriate place in the tree.

Microsimulation - use trackers

If you have a microsimulation model you can create a tracker to record how many times you have been in a state. You create the tracker at the place in the model where you return to the state again. Then the tracker just increments using the formula below, counting the number of times in the state.

_track_count = _track_count +1

Similar to the Cohort example, you can then use the tracker to get the appropriate value from the table:

prob_AtoB = table_Prob_AtoB[ _track_count ]

Please sign in to leave a comment.