Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: quotes and double-quotes problems


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: quotes and double-quotes problems
Date   Thu, 28 Apr 2005 17:31:08 +0100

Try 

forval i = 1/3 {
	local vlabel: label(`y') `i'
	local vlabels `"`vlabels' `"`vlabel'"'"' 
}

that is 
	ldq lq rq ldq lq rq rdq rdq 
       L                       R
	     L  R  L          R
                     L  R

It is just like grade school algebra:  

	{   (  ) [    (  )   ]  } 

Mind you, I haven't tested this! 

Nick 
[email protected] 

Richard Williams
 
> Stata drives me crazy with all its quotes and double-quotes.  
> I am trying 
> to get value labels returned the same way that mlogit does 
> it, e.g. if the 
> labels are
> 
> Very SD
> Somewhat "D"
> I `Strongly' Agree
> 
> (Labels deliberately chosen to cause as much trouble as 
> possible.) mlogit 
> will return in e(eqnames)
> 
> `"Very SD"' `""Somewhat" D"' `"I `strongly' agree"'
> 
> which will parse as 3 different words.  Now, I know how to 
> get the value 
> labels, but I can't for the life of me get all the quotes and 
> double-quotes 
> right, e.g. I do something like
> 
>          forval i = 1/3 {
>                  local vlabel: label(`y') `i'
>                  local vlabels `vlabels' `vlabel'
>          }
> 
> 
> and it of course doesn't work right.  But, I've also tried 
> also sorts of 
> combos involving `" and "' and it still never comes out right 
> - I always 
> wind up with extra or missing quotes and double-quotes.  Any 
> help would be 
> appreciated.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index