I'm sure this is somewhat simple but haven't been able to wrap my head around it, so here it goes:
How to segment the following example of a macro
"x1 x2 x3 x4 y1 y2 y3 y4 z1 z2 z3 z4"
into the following macros
"x1 x2 x3 x4"
"y1 y2 y3 y4"
"z1 z2 z3 z4"
------
Additionally, can you set a macro name in relation to the value of another one?
Ex: say I have
local counter_i: "98".
Can I generate a macro called year_98 by referencing it to `counter_i'?
Have tried to so by coding local year_`counter_1' --as I would do, for example, to name a variable, But stata keeps telling me that is an invalid syntax.
Thanks in advance for your help, and apologize in advance for any lack of technicalities or ambiguities in my terminology.
Best,
Sergio.
Related Posts with Dividing a macro into segments of equal number of elements.
XtdataDear community, I have a burning question for you So I have a panel regression and would like to e…
Robustness test with GENDERDear Statalist, here is my situation that may sound a bit silly.... I'd like to ask if I want to ru…
Quantile Diff-in-diff with fixed effectsDear Stata users. I wish to estimate quantile difference-in-difference (DID) model with fixed effect…
-nbvargr- download fails, Stata 12Stata Version: 12 Dear all, I've tried to download the user written command -nbvargr-, however I r…
Tabulating/ graphing with an unconventional time variableGood afternoon, I have a 5-quarter longitudinal dataset and am trying to tabulate and graph the cha…
Subscribe to:
Post Comments (Atom)
0 Response to Dividing a macro into segments of equal number of elements.
Post a Comment