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
How to add fixed regressors in NARDL modelHi My questions are on Nonlinear and Asymmetric Autoregressive Distribution Lag Model (NARDL) 1. Ho…
Interpreting test results on panel data and how to correctly perform fixed effect regression on panel dataHi members, I have a large set of panel data with information about 166 bonds, containing some of t…
R script from STATAHello everyone, I am trying to run some R-code through STATA but I am experiencing some issues and …
How to do the Interaction plot with continuous variables and constrain other control variables at meanTo whom can solve this problem: Please kindly help! I need to draw an interaction plot figure to se…
NAs and missing valuesI am a stata novice, using stata for the first time in life. I have multiple variables as strings (…
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