Say for a command, we must specify a minimization period like age15to24(1980(1)1988)
Where the goal is to build a macro like "lnincome(1980(1)1988) retprice(1980(1)1988) age15to24(1980(1)1988)". When I do di `i' however, we see
How might I make a macro that has all these, not just age?
Code:
clear *
capture program drop gsheet
program define gsheet
syntax anything , key(string) id(string)
local url "https://docs.google.com/spreadsheets/d/`key'/export?gid=`id'&format=csv"
copy "`url'" `anything', replace
noi disp `"saved in `anything'"'
import delim using `anything', clear bindquote(strict)
erase `anything'
end
gsheet "`c(pwd)'\\test.csv" , key("1NZQSPAD4-TWpqLmhKt3dR8cq82WIh4LqdhXIF33KNK8") id("1600547932")
cls
labmask state_fips, values(state)
xtset state_fips year, y
local lbl: value label `r(panelvar)'
loc unit ="California":`lbl'
cls
foreach v of var lnincome retprice age15to24 {
local i `v'(1980(1)1988)
di "`i' " _continue
}
di "`i'"
Code:
. foreach v of var lnincome retprice age15to24 {
2.
.
. local i `v'(1980(1)1988)
3.
. di "`i' " _continue
4.
.
. }
lnincome(1980(1)1988) retprice(1980(1)1988) age15to24(1980(1)1988)
. di "`i'"
age15to24(1980(1)1988)

Comment