Hello,
I have a panel dataset (2013-2018) in which I want to delete all observation of which I do not have all the observations needed to perform my regression. However, I regress the independent variables of last year on the dependent variable, which means that I have to set 3 different conditions to keep observations:
- for 2013: drop observations for which not all independent variables are available
- for 2014-2017: drop observations for which not all independent variables and the dependent variable is not available
- for 2018: drop only if the dependent variable is not available
I have tried several possibilities by creating conditions within the keep command or by using command egen. However, I do not seem to succeed. Do you have any recommendations? Please let me know if you need any additional information.
Thank you very much.
Kind regards,
Timea
Related Posts with drop missing variables except for one year
Compute Estimated Hazard and Plot Estimated Hazard Curve after Fitting a xtmelogit Survival Model in StataThe dataset is presented below, insheet using "https://ift.tt/aXA9elG", comma foreach i of varlist …
renaming all value labels in a datasetI currently am working to merge two data sets. They both have unique variable names except FamilyID …
Undisplayed dates: weekends, public holidays, and other reasonsHi I have a dataset that includes daily observations and a daily date variable (DATE). Some dates a…
generate variable on the basis of industry year and firmDear Forum, I have the following very basic problem. Unfortunately, I couldn't find an appropriate s…
"variable at_exp_share11 already defined" is always displayed when I run the command."variable at_exp_share11 already defined" is always displayed when I run the command. But I can conf…
Subscribe to:
Post Comments (Atom)
0 Response to drop missing variables except for one year
Post a Comment