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
Counterfactual decomposition issueHi all, I want to use counterfactual decomposition method with a binary dependent variable. I used …
Create several histograms same pictureHello, I would like to have several histograms in the same picture with the answers (inapplicable, …
error message when using XtgraphHello, I am currently having some issues using xtgraph that I haven't experienced before. When I us…
Dealing with Product wise and Year wise firm dataI am working on a data that consists the following variables - firms, years and the product codes of…
Bootstrapping for logistic regression on imbalanced dataHi there, I've googled quite a bit but haven't quite figured out how to implement this in STATA. I …
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