Hey guys,
I am struggling a bit with dropping a whole panel if a condition is met.
I have a unique ID and time variables showing development of ID over time and i am trying to do panel survival analysis using xtstreg. First, however, I need to remove all observations relating to ID's with a specific characteristic. I have used the following commands:
gen flag=0
replace flag if (my set of criteria)
drop if flag(_N)==1
as i understood from previous discussions stata should decode that all obs in the panel need to be deleted if at least one violated my set of conditions by including (_N) in the command, but it returns following error:
factor-variable and time-series operators are not allowed.
Can anyone advice on how to eliminate this errror?
I am struggling a bit with dropping a whole panel if a condition is met.
I have a unique ID and time variables showing development of ID over time and i am trying to do panel survival analysis using xtstreg. First, however, I need to remove all observations relating to ID's with a specific characteristic. I have used the following commands:
gen flag=0
replace flag if (my set of criteria)
drop if flag(_N)==1
as i understood from previous discussions stata should decode that all obs in the panel need to be deleted if at least one violated my set of conditions by including (_N) in the command, but it returns following error:
factor-variable and time-series operators are not allowed.
Can anyone advice on how to eliminate this errror?
Comment