Statalist The Stata Listserver


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

st: RE: different order of variable values in tab command


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: different order of variable values in tab command
Date   Wed, 12 Apr 2006 12:44:16 +0100

I am not clear whether 1 0 is as much 
as you want here, but I think the answer
is the same for more extensive examples: 

you need to negate your numeric variable -- or more 
generally set up a one-to-one reversal -- and then 
attach value labels that show what you
want. 

sysuse foreign, clear
gen newforeign = - foreign
label def newforeign -1 "1" 
label val newforeign newforeign
tab newforeign 

For more complicated problems, check out -labmask-
from -labutil- on SSC. 

Nick 
n.j.cox@durham.ac.uk 

Josť Maria

> Is there any option (not yet in the manual) to present de values of a 
> variable in a different way of the default, which orders de 
> values from 
> smaller to larger (0 1 2 ...)?
> I would like to present the results in the order 1 0.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index