Statalist


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

st: RE: RE: egen(cut)


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: egen(cut)
Date   Thu, 23 Oct 2008 13:48:11 +0100

Independently of that -egen, cut()- does not sound the best bet for what I guess to be your problem. Perhaps you need -round()-, -floor()- or -ceil()-. 

Nick 
[email protected] 

Martin Weiss

-egen, cut()- takes a numlist for the -at()- option, so it must respect -h limits- for -nulist: 1,600 elements.

Try this (and observe where Stata`s complaints start):


************
sysuse auto, clear

egen newmpg=cut(mpg), at(12/41)
drop newmpg
egen newmpg=cut(mpg), at(12(0.1)41)
drop newmpg
egen newmpg=cut(mpg), at(12(0.01)41)
drop newmpg
************

Katia Bobulova

I am using egen with cut to divide my time in intervals:

egen newtime=cut(time), at(17000,170500....)

I there a limit for at?

Because I have many intervals and it doesn't work, so I treid to split
in two and it works.

However, now I have a problem. How to add the observation of the two
variables(because I generate two newtime for different intervals) into
one variable?

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