Statalisters,
In the example below, I have a local variable containing a list of
variable names, and in the <postfile> procedure I want to post each
variable name in that list. In particular, I want the variable "var" in
the tempfile "predictions" to be a string and to have an entry of "mcd"
in obs 1 and an entry of "priv" in obs 2. The way it is currently
written, it posts the VALUE of each variable in the list. Can anyone
please help with this?
Much thanks,
Danielle Ferry
local insvars "mcd priv ";
tempname memhold;
tempfile predictions;
postfile `memhold' var z1 z2 using `predictions';
foreach var of varlist `insvars' {;
[do stuff]
post `memhold' (`var') (`a') (`b');
};