I have a panel dataset with over 1mln person-month observations. I use Stata 18. Each monthly observation has time var yr_mo (yyyymm), starting from 201701 to 202304; Age var age ("yy.y" ex: "60.4" numeric format); unique identifier randid (numeric) and other variables. The age variable is coded at the time when the individual enters the panel (so not everyone starts at 201701, some join later, and others exit) and does not change going forward. For example, randid 12343 would join the panel in 201704 at the age of 61.4 and stay in the panel until 202304, with the same age for every subsequent month.
How do I write a code that will take the initial age when the individual joins the panel and progress it forward until 202304 or when they exit?
How do I write a code that will take the initial age when the individual joins the panel and progress it forward until 202304 or when they exit?
Comment