user319487
user319487

Reputation:

How can I modify output of Stata's describe command?

When using Stata's describe (docs):

sysuse auto
d

I get the following output:

Contains data from /usr/local/stata13/ado/base/a/auto.dta
  obs:            74                          1978 Automobile Data
 vars:            12                          13 Apr 2013 17:45
 size:         3,182                          (_dta has notes)
----------------------------------------------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
----------------------------------------------------------------------------------------------------------------------------
make            str18   %-18s                 Make and Model
price           int     %8.0gc                Price
mpg             int     %8.0g                 Mileage (mpg)
rep78           int     %8.0g                 Repair Record 1978
headroom        float   %6.1f                 Headroom (in.)
trunk           int     %8.0g                 Trunk space (cu. ft.)
weight          int     %8.0gc                Weight (lbs.)
length          int     %8.0g                 Length (in.)
turn            int     %8.0g                 Turn Circle (ft.)
displacement    int     %8.0g                 Displacement (cu. in.)
gear_ratio      float   %6.2f                 Gear Ratio
foreign         byte    %8.0g      origin     Car type
----------------------------------------------------------------------------------------------------------------------------
Sorted by:  foreign

Is it possible to remove the value label from the displayed results?

Upvotes: 1

Views: 91

Answers (1)

Nick Cox
Nick Cox

Reputation: 37208

If you want to see everything but value label names, that's programmable but cannot I think be achieved by option choices.

Here is a first approximation to such a program:

program mydescribe
    version 8.2 
    syntax [varlist]  

    di 
    foreach v of local varlist { 
        di abbrev("`v'", 20)                _c 
        di "{col 22}`: type `v''"           _c 
        di "{col 30}`: format `v''"         _c
        di "{col 38}`: variable label `v''"  
    } 
end 

Upvotes: 1

Related Questions