Announcement

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

  • Empty line in output of describe command

    An empty line occurs in the output of the Stata's describe command, as can be seen from this example:

    Code:
    clear all
    generate byte urbanrural=1
    label define urbanrural 0 "Rural" 1 "Urban"
    label values urbanrural urbanrural
    generate x=1
    describe
    results in:
    Code:
    Contains data
     Observations:             0                  
        Variables:             2                  
    ------------------------------------------------------------------------------------------------
    Variable      Storage   Display    Value
        name         type    format    label      Variable label
    ------------------------------------------------------------------------------------------------
    urbanrural      byte    %8.0g      urbanrural
                                                  
    x               float   %9.0g                 
    ------------------------------------------------------------------------------------------------
    Sorted by: 
         Note: Dataset has changed since last saved.
    This is not a big deal, but rather counterintuitive and made me wonder a couple of times if a variable was somehow 'suppressed' in the output (similar to how it is done in the [weird] output of graph query ).

    (Stata 17.0/Windows)

    Thank you, Sergiy

  • #2
    It seems to happen when the length of the name of the value label exceeds 8 characters, because a separate line is needed if there is a variable label. Since it is not needed in the absence of a variable label, I would class this as an unintended feature.
    Code:
     clear all
    
    . generate byte urbanrural=1
    
    . label values urbanrural u23456789
    
    . generate x=1
    
    . describe
    
    Contains data
     Observations:             0                  
        Variables:             2                  
    ------------------------------------------------------------------------------------------------
    Variable      Storage   Display    Value
        name         type    format    label      Variable label
    ------------------------------------------------------------------------------------------------
    urbanrural      byte    %8.0g      u23456789
                                                  
    x               float   %9.0g                 
    ------------------------------------------------------------------------------------------------
    Sorted by: 
         Note: Dataset has changed since last saved.
    
    . label variable urbanrural "whatever"
    
    . describe
    
    Contains data
     Observations:             0                  
        Variables:             2                  
    ------------------------------------------------------------------------------------------------
    Variable      Storage   Display    Value
        name         type    format    label      Variable label
    ------------------------------------------------------------------------------------------------
    urbanrural      byte    %8.0g      u23456789
                                                  whatever
    x               float   %9.0g                 
    ------------------------------------------------------------------------------------------------
    Sorted by: 
         Note: Dataset has changed since last saved.
    
    .

    Comment

    Working...
    X