Closed timcras closed 4 years ago
There are a couple of different approaches you could use.
If you are using an individual-level (Monte Carlo) simulation:
timeSick
initialized to 0 (as it is by default)timeSick++
. This counts the number of cycles that an individual has spent in the Sick state.if
function to check if it is the first cycle in the Sick state. Because variable updates are applied before probabilities are evaluated (see https://github.com/zward/Amua/wiki/FAQ#What-is-the-order-of-operations-at-each-node), timeSick
will be 1 in the first cycle.
So you could specify a time-dependent probability: if(timeSick==1,1,0)
If you are using a cohort simulation you could use a 'tunnel state' where people stay in Test for one cycle before going to Sick. (This approach could work for an individual-level simulation too.) With this approach I think you'd have to be more careful though about accounting for utilities and competing risks, depending on the cycle length:
Dear Zach,
If I want a person to have a test for example only the first year that that person is in that state, how do I do that? Below is what I found about this question for Treeage. I'm particularly interested in the 'time in state' time dependent value, but also the one concerning Age. Thanks very much in advance!
TreeAge Pro supports time‐dependent values • Time – f(_stage) • Age– f(_stage + startAge) • Time in state – f(_tunnel)