Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: AW: Re: Problem putting enclosed double quotes (was: Problem putting enclosed brackets). |

Date |
Thu, 1 Apr 2010 13:39:34 +0200 |

<> Have you had a look at Ian Watson`s ************* ssc d tabout ************* as well? HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Amadou DIALLO Gesendet: Donnerstag, 1. April 2010 13:36 An: statalist@hsphsun2.harvard.edu Betreff: st: Re: Problem putting enclosed double quotes (was: Problem putting enclosed brackets). Dear Nick, Thanx for your answer. I have several purposes in doing that. But the most urgent is that what I am currently doing is to pass a series of matrices to Zurab's xml_tab (it is the code that suits most my needs actually) and I want to preserve the labels of the modalities of my hundreds of variables. For short labels, there is no problem. But for long, spaced, labels, it's more complicated. See the example below: sysuse auto tab foreign rep78 , matcell(A) loc vall : val la for xml_tab A, rn("`: lab `vall' 0'" "`: lab `vall' 1'") // for my code rn will be rn(`names') Thx. 2010/4/1, Nick Cox <n.j.cox@durham.ac.uk>: > The problem is with double quotation marks "", informally often known as > (double) quotes. > > (The word brackets even at its most generous doesn't I think extend beyond > > round brackets or parentheses () > > [square] brackets [] > > and curly brackets or braces {}.) > > The problem is that Stata uses " " in two ways, as string delimiters and as > literal characters. First time round, the " " are being interpreted as > delimiters and as such stripped. > > Although I tried a few solutions using compound double quotes `" "' I also > failed to get precisely what Amadou wants. So, I am tempted to change the > question. Why do you want precisely this? I suspect that there are other > ways of getting the same ultimate result. > > Nick > n.j.cox@durham.ac.uk > > Amadou B. DIALLO, PhD. > > I want to have the following labels of my variables enclosed into > encapsulated brackets but the code fails: > > Instead of having the following desired form: > "Augmenté" "Inchangé" "Diminué" "Non concerné" > > I have : > Augmenté "Inchangé" "Diminué" "Non concerné" > > I.e. stata keeps ignoring the first label value. > > My code is as follows: > > qui foreach i of local vars { > loc vall : val la `i' > if "`vall'" ~= "" { > levelsof `i', l(l) > foreach k of local l { > loc lab : lab `vall' `k' > loc names `names' "`lab'" // loc names `names' "`: lab `vall' `k''" > } > } > } > di `"`names'"' > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > -- Amadou B. DIALLO, PhD. Economist (Anti-Poverty Programs - DR Congo), AFTP3, The World Bank, Washington DC. Director, Center for Research and Training on Adult Health and Education. Mayotte (FRANCE). www.aprosasoma.org * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: Re: Problem putting enclosed double quotes (was: Problem putting enclosed brackets).***From:*Amadou DIALLO <stata.diallo@gmail.com>

- Prev by Date:
**st: Re: Problem putting enclosed double quotes (was: Problem putting enclosed brackets).** - Next by Date:
**st: RE: Re: Problem putting enclosed double quotes (was: Problem putting enclosed brackets).** - Previous by thread:
**st: Re: Problem putting enclosed double quotes (was: Problem putting enclosed brackets).** - Next by thread:
**st: RE: Re: Problem putting enclosed double quotes (was: Problem putting enclosed brackets).** - Index(es):