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.
Marginal Effects for Bivariate Random Effects ProbitHi, I am in the process of trying to run a Bivariate Random Effects Probit (Plum, 2016) to analyse …
Fixed Effects & Ordered Probit (RE) for same panel?Hey Folks! I hope I am not getting too annoying with my questions. I have encountered the following…
plotting confidence intervals in stataDear All, i have risk ratios for a disease with their confidence intervals by age group and i am plo…
Threshold, Gaps Not allowedI am working with threshold regression: I have quarterly data (strongly balanced) Stock_return=const…
Saving table behind histogramI am using a histogram, and I want to save a table underlying the graph. for instance: sysuse …
Subscribe to:
Post Comments (Atom)
0 Response to Dividing a macro into segments of equal number of elements.
Post a Comment