Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -inlist- / double quote problem?


From   "Danielle H. Ferry" <dferry@nber.org>
To   statalist@hsphsun2.harvard.edu
Subject   st: -inlist- / double quote problem?
Date   Tue, 23 May 2006 11:35:09 -0400

Hi all,
Can someone please help me figure out why the first -levelsof- statement,
below, isn't producing anything? The output from the -di- statement leads me
to believe that the -inlist- portion of the last statement should give me what
I want, but it clearly does not. As you can see, if I specify the arguments of
-inlist- directly, I get the result I want. 
Thank you,
Danielle Ferry

. global regOnlyVars2 `" "corr_ue", "vol_ue" "';

. di `"$regOnlyVars2"';
 "corr_ue", "vol_ue" 

. levelsof indepvar
>         if inlist(indepvar2, `"$regOnlyVars2"'), 
>         local(indepvars) cl;

. levelsof indepvar
>         if inlist(indepvar2, "corr_ue", "vol_ue"), 
>         local(indepvars) cl;
L2.corr_ue L3D.vol_ue

--
National Bureau of Economic Research <http://www.nber.org>

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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