Hi. I have panel data from 2009-2016. I want to remove individuals from the data set if the variable of interest is always negative (negative in each year). However, if the variable is positive in one or more years then I want the individual to still be in the data set for all years, including their negative value. I will try illustrate the problem:
ID Year VAR1
1 2009 -10
1 2010 10
1 2011 5
1 2012 -3
2 2009 -1
2 2010 -2
2 2011 -5
2 2012 - 9
Desired outcome:
ID year var1
1 2009 -10
1 2010 10
1 2011 5
1 2012 -3
In this case, individual 2 should be dropped, while individual 1 shall remain in the data set, with the values for each of the years, indepenent of negative values.
All help is greatly appreciated.
Related Posts with Panel data - removing individuals if criteria is not met in each year
removing intercepts from groups of dummy variables in panel datahi there, so i have a panel regression of 174 nations and their GDP growth for every year 1994-2017,…
Reshape the data-set into a specified formI have a data-set contains the following variables. And, I want to reshape the data-set into a speci…
Not a numberHi, While trying to import a CSV dataset with Covid data for France, I realized there are numeric v…
Measuring the average Wage before and After movingHello Members, I have data on individuals moving across regions and I have grouped each region into…
Using python integrated in Stata version below 16Hi All, I'm trying to install python and its package in Stata version 15.1 SE but do not success du…
Subscribe to:
Post Comments (Atom)
0 Response to Panel data - removing individuals if criteria is not met in each year
Post a Comment