Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: SImple question on "describe"


From   "David Harrison" <[email protected]>
To   <[email protected]>
Subject   st: RE: SImple question on "describe"
Date   Wed, 21 Jun 2006 09:01:19 +0100

For the second part (both varname and label in tables), I would suggest
writing a wrapper that (1) relabels your variables so that the variable
label includes the variable name, (2) does the tabulation, then (3)
relabels them back how they were. An example for the command -table- is
below.

Hope this helps

David


prog tablevl
    syntax varlist(min=1 max=3) [if] [in] [fw aw pw iw] [, *]
    tokenize `varlist'
    local i 0
    while !missing("``++i''") {
        local lab`i' : var lab ``i''
        label var ``i'' `"``i'': `lab`i''"'
    }
    cap nois table `varlist' `if' `in' [`weight' `exp'], `options'
    local rc _rc
    local i 0
    while !missing("``++i''") {
        label var ``i'' `"`lab`i''"'
        if `rc' {
            exit `rc'
        }
    }
end

. sysuse auto
(1978 Automobile Data)

. tablevl rep78 foreign, c(mean price)

------------------------------
rep78:    |
Repair    |
Record    | foreign: Car type 
1978      | Domestic   Foreign
----------+-------------------
        1 |  4,564.5          
        2 |  5,967.6          
        3 |  6,607.1   4,828.7
        4 |  5,881.6   6,261.4
        5 |  4,204.5   6,292.7
------------------------------


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of buddyb
Sent: 21 June 2006 01:45
To: [email protected]
Subject: st: SImple question on "describe"

Hi, 

I've checked the user's guide, programming and the reference guide.  I
want to use describe and only want the variable name and variable label
- not the other information.  Also, when I use a table command - I would
like to see BOTH the variable name and the variable label - is this
possible? 

Thanks,
Buddy 

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index