[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: local macro dereferencing

From   "Martin Weiss" <>
To   <>
Subject   st: AW: local macro dereferencing
Date   Mon, 10 Aug 2009 16:58:42 +0200


A good place to start would probably be


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Nelson, Carl
Gesendet: Montag, 10. August 2009 16:38
Betreff: st: local macro dereferencing

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

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 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
      = mata: gmmrsk("share_riskyassets_broad","risktol_m risktol_f","wlt
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?

Carl Nelson

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index