Hello Statalist,
I am writing a long .do file that uses the same command at many different points:
keep if geo_id == "1600000US0606028" | geo_id == "1600000US0612048" | geo_id == "1600000US0614260" | geo_id == "1600000US0618986" | geo_id == "1600000US0618996" | geo_id == "1600000US0619022" | geo_id == "1600000US0636434" | geo_id == "1600000US0636448" | geo_id == "1600000US0636452" | geo_id == "1600000US0640354" | geo_id == "1600000US0629112" | geo_id == "1600000US0646660" | geo_id == "1600000US0652302" | geo_id == "1600000US0653224" | geo_id == "1600000US0655184" | geo_id == "1600000US0655254" | geo_id == "1600000US0659500" | geo_id == "1600000US0672156" | geo_id == "1600000US0678456" | geo_id == "1600000US0678596" | geo_id == "1600000US0683085" | geo_id == "1600000US0685208"
It takes up a lot of space and looks messy, so I'd like to be able to use a macro (or some other method) to store this exact line of command so that I can reference it in the .do file without having to copy and paste the long command line.
Is this possible?
Thanks,
Ian
Related Posts with Storing a command as a macro
Help replacing individual data from household data, using macros over variable names.Hi there, I have only recently started using Stata to edit data, instead of using the default datas…
Descriptive statistics; graph illustrating effects on Y before and after treatment (Stata 16)Dear Statalisters, I have an unbalanced panel dataset with approx. 12,300 observations and am analy…
Can I use diff-in-diff for my research setting?I want to use the legislation adoption at the state level to perform a diff-in-diff in my panel data…
Women wage dataHello! Can anybody help me how can I download the sample data of heckamane "women wage data"? Thank …
profileplot - change line colours based on a third variableI want to show the change of a numerical score in 68 indivials at two time points, before and after …
Subscribe to:
Post Comments (Atom)
0 Response to Storing a command as a macro
Post a Comment