Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Viewing variable labels and notes at the same time


From   Venable <[email protected]>
To   [email protected]
Subject   Re: st: Viewing variable labels and notes at the same time
Date   Thu, 17 Mar 2011 09:29:55 -0400

Thank you both very much, these work quite well.


On Wed, Mar 16, 2011 at 7:00 PM, Nick Cox <[email protected]> wrote:
> You can program this for yourself, subject to the limitation that the
> notes for a variable could be far, far larger than would fit on to a
> single line. This is quick and dirty code only.
>
> sysuse auto, clear
>
> notes mpg : Miles per gallon are strange and arbitrary units from many
> points of view. Even if you feel committed to units understood
> parochially in the U.S.A., gallons per mile make more engineering or
> physics sense. Further, if you follow the standards of international
> science, you would prefer SI units, but even litres are marginal from
> that point of view.
>
> foreach v of var * {
>        di as txt _n abbrev("`v'", 20) "{col 22}`: var label `v'' " _c
>        notes `v'
> }
>
> Nick
>
> On Wed, Mar 16, 2011 at 10:08 PM, Venable <[email protected]> wrote:
>>
>> Is it possible to view lists of variables that display both variable
>> labels and notes at the same time?
>>
>> What I have in mind is something like the output one gets from
>> display, except including any variable notes in the same line as the
>> variable name, value label, variable label, etc. Currently, display
>> shows an asterisk indicating that a given variable has notes - I
>> suppose what I would like is for the actual note or notes to appear in
>> place of the asterisk.
>>
>> For example:
>>
>> sysuse auto
>> notes make: Test note 1 (make)
>> notes price: Test note 2 (price)
>> desc make price
>>
>> yields
>>
>>              storage  display     value
>> variable name   type   format      label      variable label
>> -------------------------------------------------------------------------------
>> make            str18  %-18s                * Make and Model
>> price           int    %8.0gc               * Price
>>
>> and what I would like to have is something like (with apologies for
>> the formatting-by-hand)
>>
>> variable name    variable label   notes
>> -------------------------------------------------------------------------------
>> make      Make and Model         Test note 1 (make)
>> price       Price                         Test note 2 (price)
>>
>>
>>
>> The reason I ask (in case there's a better way to address the problem)
>> is that I use the variable label in tables and graphs, which requires
>> using a fairly short label, but I also want to have information about
>> the origin of a variable, which is better suited to a note.
>>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index