I know how to write simpel code of a macro to complete one task:
e.g. drop obervations whose var1 value is missing.
global drop_missing "drop if var1 =."
But how can I write simpel code of a macro to complete multiple tasks?
e.g. drop obervations whose var1 value is missing, then drop those whose var2 value is missing, then drop those whose var3 value is missing.
global drop_missing "drop if var1 =. drop if var2 =. drop if var3 =."
The above line of code is definitively wrong. How can I write this code?
I do not know how to properly phrase this question, so I cannot search and find any previous Q&As.
Thank you for any advice/comments!
Related Posts with Multiple Tasks in a Macro
How to group several columns?I am dealing with data with information of different candidates, the results of each candidate is di…
Breusch and Pagan LM test for random effectsDear community, I am deciding among Pooled OLS, Fixed and Random Effects panel models in the presen…
Puzzling Post Hoc Power CalculationI was trying to show a colleague that post hoc power calculations are nonsensical with the following…
Applying the Mundlak approach in 3-level hierarchical model. Which is the correct mean of a level-2 variable?Hello! We have a question about implementing the ‘Mundlak’ approach in a multilevel (3-levels) nest…
Error exporting dataset to excel using foreach loopHello, I am trying to export data set to excel using foreach loop in STATA 13.1. But the stata throw…
Subscribe to:
Post Comments (Atom)
0 Response to Multiple Tasks in a Macro
Post a Comment