Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: behaviour of cut


From   Christopher F Baum <[email protected]>
To   [email protected]
Subject   st: Re: behaviour of cut
Date   Sat, 10 Aug 2002 07:47:26 -0500

--On Saturday, August 10, 2002 2:33 -0400 Nick wrote:

There is the question of what happens below the lowest left-hand end.

If I go

egen cmpg = cut(mpg), at(15(5)45)

values below 15 are also mapped to missing. The attitude is
tough: "You didn't say what you wanted doing with values
below 15, so I don't know what to do with them.". This could be
regarded as fit punishment, or a suitable reply, that is,
the user got what was asked for, no more, no less.
Also note the closely related function recode() -- which although it will not take a numlist, labels values with the RIGHT hand endpoint of an interval (except for the top-coded values):

g dmpg=recode(mpg,15,20,25,30,35,40)

compare with the egen above.

Kit

*
* 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