Dear Statalist
I would like to create a local macro for an if-condition that already includes double quotation marks (" "). And I would like to ask how I may accomplish this without confusing Stata because of the multiple " " marks. To illustrate what I mean:
In this context, please imagine the if-condition
to be much longer & that I would like to include the actual labels instead of, e.g. foreign == 1, to improve readability for my coauthors.
It would be ideal if I can do something like
But, as it stands, the multiple " " marks are causing confusion.
Thanks,
Junran
I would like to create a local macro for an if-condition that already includes double quotation marks (" "). And I would like to ask how I may accomplish this without confusing Stata because of the multiple " " marks. To illustrate what I mean:
Code:
sysuse auto, clear regress price mpg if foreign == "Domestic":origin
Code:
if foreign == "Domestic":origin
It would be ideal if I can do something like
Code:
local ifcond = "if foreign == "Domestic":origin" regress price mpg `ifcond'
Thanks,
Junran
Comment