This is a typical problem that can be encountered in panel data when I want to exclude certain subjects who don't meet my inclusion criteria. For example, from the table below year id v1 v2 v3 1 1 1 23 0 2 1 2 23 0 3 1 3 23 1 1 2 1 14 0 2 2 3 23 0 3 2 2 23 0 1 3 2 25 0 2 3 2 2 0 3 3 1 3 0 One of my criteria is that a subject that v3=1 shouldn't be included. Thus, I want to eliminate all observations from id 1 (year1-3). Likewise, I have another condition that a subject who shows decrease in v2 should not be included. Then, all observations from id 3 should be also eliminated. As a result, the table I want to see is. year id v1 v2 v3 1 2 1 14 0 2 2 3 23 0 3 2 2 23 0 What codes can I use for handling this problem?
... View more