I am working with data, where certain time-invariant variables, e.g. sex and birth year, are changing over time. How do I delete the observations where this happens?
The data is a long panel data set: xtset id year

Here, observations with id==102 should be removed because sex changes over time, and observations with id==103 because ybirth changes over time.
Just typing "drop if inlist(id,102,103)" is not convenient because my data set is extremely large and a lot of observations should be removed
Thank you in advance
The data is a long panel data set: xtset id year
Here, observations with id==102 should be removed because sex changes over time, and observations with id==103 because ybirth changes over time.
Just typing "drop if inlist(id,102,103)" is not convenient because my data set is extremely large and a lot of observations should be removed
Thank you in advance
Comment