Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Problem putting enclosed brackets.

From   Amadou DIALLO <>
Subject   st: Problem putting enclosed brackets.
Date   Thu, 1 Apr 2010 10:18:02 +0100

Dear all,
I've been struggling for days with the following problem.
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'"'



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).

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index