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
Analyzing individual quiz scores with group quiz scoresDear Statlist experts, I have a data set of the performance of graduate course participants (n=30).…
How to Save a File After a String ValueHello. This should be rather easy for folks here, but I am stymied. I have a rather simple dataset;…
Preparing Panel Data with repeated time values within panel (xtset)Hey everyone, I am working with survey data (PSID) and am currently facing some difficulties regardi…
Constructing panel data setHi I am trying to construct a panel dataset comprised of yearly observations of import values for d…
how to loop with tab2xl?I tried to use tab2xl in a loop to generate sheets faster, but after running the code there's no fil…
Subscribe to:
Post Comments (Atom)
0 Response to Panel data - removing individuals if criteria is not met in each year
Post a Comment