Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Display the entire variable's names in "tab"

    Dear Profs and colleagues,

    There is an eduction variable, and its names are pretty long, in tab I need to see the whole name because I am going to categorize them into a group.
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str70 education
    "Licenc. Engenharia e Técnicas Afins"                                  
    "Ensino Técnico:C.Ger.Comerc.,C.Ger.Indust.,C.Ger.Art.Visuais"         
    "Ensino Técnico:C.Ger.Comerc.,C.Ger.Indust.,C.Ger.Art.Visuais"         
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "3.Ciclo Ensino Básico (Ant.5.Ano Liceu,9.Ano Unificado)"              
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "Bach. Engenharia e Técnicas Afins"                                    
    "Ensino Secundário(12.Ano) Eq.c/Curs.I.Profis.,E.S.Lic.Compl."         
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "Licenc. Comercio e Administração"                                    
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"                        
    "1.Ciclo Ensino Básico (Ens.Primario 4.Classe)"   
    
    
    . tab education
    
                     Habilitações Escolares |      Freq.     Percent        Cum.
    ----------------------------------------+-----------------------------------
    1.Ciclo Ensino Básico (Ens.Primario 4.. |    807,591       33.47       33.47
    1.Ciclo Ensino Básico C/Cursos Índole.. |     11,225        0.47       33.94
    2.Ciclo Ensino Básico (Ens.Preparator.. |    523,637       21.70       55.64
    2.Ciclo Ensino Básico C/Cursos Índole.. |     11,122        0.46       56.10
    3.Ciclo Ensino Básico (Ant.5.Ano Lice.. |    348,824       14.46       70.56
    3.Ciclo Ensino Básico C/Cursos Índole.. |      3,616        0.15       70.71
    Bach. Agricultura, Silvicultura e Pesca |        994        0.04       70.75
            Bach. Arquitectura e Construção |      1,488        0.06       70.81
                                Bach. Artes |        570        0.02       70.83
                     Bach. Ciências Físicas |        216        0.01       70.84
                Bach. Ciências Informáticas |        973        0.04       70.88
    Bach. Ciências Sociais e do Comportam.. |        791        0.03       70.91
                Bach. Ciências Veterinárias |         11        0.00       70.91
    what I am going to do is:
    Code:
    gen Edugroup=.
    replace Edugroup=1 if educ== "Sabe Ler e Escrever Sem Possuir 1.Ciclo Ensino Básico" | educ==""  | educ==""
    replace Edugroup=2 if educ==
    replace Edugroup=3 if educ==
    replace Edugroup=4 if educ==
    Any ideas would be appreciated.

    Cheers,
    Paris

  • #2
    Let's be clear. It is not the variable name you want to see; it's the values of a string variable, which could be enormously long, so it follows that tabulate must have a limit. In practice too, rather than in principle, I don't know of a way to tune how much space is given to the text in tabulate.

    In better news groups from the Stata Journal is more generous here.

    Code:
    . groups education 
    
      +-----------------------------------------------------------------------------------------+
      |                                                    education   Freq.   Percent      %<= |
      |-----------------------------------------------------------------------------------------|
      |                1.Ciclo Ensino Básico (Ens.Primario 4.Classe)      11     61.11    61.11 |
      |      3.Ciclo Ensino Básico (Ant.5.Ano Liceu,9.Ano Unificado)       1      5.56    66.67 |
      |                            Bach. Engenharia e Técnicas Afins       1      5.56    72.22 |
      | Ensino Secundário(12.Ano) Eq.c/Curs.I.Profis.,E.S.Lic.Compl.       1      5.56    77.78 |
      | Ensino Técnico:C.Ger.Comerc.,C.Ger.Indust.,C.Ger.Art.Visuais       2     11.11    88.89 |
      |-----------------------------------------------------------------------------------------|
      |                             Licenc. Comercio e Administração       1      5.56    94.44 |
      |                          Licenc. Engenharia e Técnicas Afins       1      5.56   100.00 |
      +-----------------------------------------------------------------------------------------+

    Comment


    • #3
      Dear Nick,

      Thank you so much.
      It is perfect.

      Comment

      Working...
      X