How to drop observations based on the values of a variable in longitudinal data? For example, I want to drop the observation of 100059 at wave 1, 2, 3, and 4 because the retirement status at the first wave was coded as missing values (i.e., .a). The code of “drop if retirement_status ==.a” drop only the observations at wave 1 if retirement_status was coded as .a; however, I am planning to drop the whole panel of 100059, including wave 1, 2, 3, and 4.
idauniq wave retirement_status
100059 1 .a
100059 2 retired
100059 3 retired
100059 4 retired
100071 1 employed
100071 2 employed
100071 3 employed
100071 4 retired
100073 1 employed
100073 2 employed
100073 3 employed
100073 4 employed
Related Posts with How to drop observations in panel data based on the values of a variable
Panel - Loop collapse or egen with conditionDear all, I googled and tried many command from yesterday and until now it's still unsuccessful. Co…
Reshape wide to long variable not foundI have been trying to reshape my data from wide to long This is an example of how it looks like: I…
Difference-in-Differences Matching with Multiple Periods TreatmentHi Everyone, I would be so pleased to get some help concerning the following issue: I have done wi…
Drop duplicate pairs (X,Y; Y,X)Unfortunately, I was not able to find out how to drop a pair of duplicates. Let's say we have variab…
Question about syntax optionsI am trying to write a program but am having difficulty with the syntax function Code: program de…
Subscribe to:
Post Comments (Atom)
0 Response to How to drop observations in panel data based on the values of a variable
Post a Comment