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
Number of ticks and format of labels on bar chartI am making a bar chart and am using the "over" option so that I can plot multiple bars for a series…
Monthly labor force status stored as a string variableHello, I am working with a data set which storing monthly labour force status during the survey ref…
r(mean) , panel subgroupDear Statalisters, I saw this old forum discussion , my question is about understanding the code : …
Checking cointegration among all possible pairs in a datasetDear All., I have the following dataset referring to daily observations for a bunch of US stocks: …
Create a variable that has only one value per categoryI have data on automobile collisions in a particular region and, among other things, have data on th…
Subscribe to:
Post Comments (Atom)
0 Response to Panel data - removing individuals if criteria is not met in each year
Post a Comment