Statalist The Stata Listserver


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

st: RE: -inlist- / double quote problem?


From   "David Harrison" <david.harrison@icnarc.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: -inlist- / double quote problem?
Date   Tue, 23 May 2006 16:50:34 +0100

You do not need the compound double quotes in your first -levelsof-
command...

After the macro substitution, Stata sees -...if inlist(indepvar2,
`""corr_ue", "vol_ue""')...-

David

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Danielle H.
Ferry
Sent: 23 May 2006 16:35
To: statalist@hsphsun2.harvard.edu
Subject: st: -inlist- / double quote problem?

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/

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

*
*   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