It's not clear to me that you're defining the -local- in the same space.
Showing enough code to see whether that is true would allow a better
answer.
Nick
[email protected]
"Nelson, Carl" <[email protected]>
I am trying to use a local macro for a long variable list but it appears
that it is not being dereferenced.
It is created with
local x1var age_m age_f incearn_m incearn_f black hispan_m healfpm
healfpf slfemp_m /*
*/ incretir_m incretir_f incgovt_m incgovt_f yrswk_m yrswk_f educ_m
educ_f /*
*/ wltagem wlt2agem wltagef wlat2agef wlteincm wlt2eincm wlteincf
wlt2eincf /*
*/ wltblack wlt2black wlthispan wlt2hispan wlthealthm wlt2healthm
wlthealthf wlt2healthf /*
*/ wltselfm wlt2selfm wltrincm wlt2rincm wltrincf wlt2rincf wltgincm
wlt2gincm wltgincf wlt2gincf /*
*/ wltyrswm wlt2yrswm wltyrswf wlt2yrswf wlteducm wlt2educm wlteducf
wlt2educf
macro list returns the correct contents of _x1var. The macro is then
used in the following statement
mata: gmmrsk("share_riskyassets_broad","risktol_m risktol_f","wlt
wlt2","`x1var'") where the mata program was defined as
mata:
mata set matastrict on
void gmmrsk(string scalar yname, string scalar hname, ///
string scalar x2name, string scalar x1name)
execution of the mata command returns
--------------------------------------------------------------------
begin gmmbarg ---
- mata: gmmrsk("share_riskyassets_broad","risktol_m
risktol_f","wlt wlt2","`x1var'")
= mata: gmmrsk("share_riskyassets_broad","risktol_m
risktol_f","wlt wlt2","")
varlist required
st_data(): 3598 Stata returned error
gmmrsk(): - function returned error
<istmt>: - function returned error
It appears to me that x1var is not being dereferenced, but I don't
understand why. What is my syntax error?
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/