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

Re: st: rounding down (and up)


From   Bill Rising <[email protected]>
To   "Stata Listserve" <[email protected]>
Subject   Re: st: rounding down (and up)
Date   Sun, 22 Jun 2003 14:37:05 -0400

On 6/22/2003 13:45, Nick Cox wrote

>Here is a little nitty-gritty problem, 
>and I do know Stata solutions. 

[snip...]
>My favourite is none of these but 
>
>	5 * floor(mpg/5) 
>

This is what I would think of right away... perhaps because...

[snip...]
 
>of APL, who introduced it some time before 1962. 

... APL used to be my programming language of choice.

>but I incline to thinking that there is 
>little pain and much gain in learning 
>how to do it with -floor()- and -ceil()-. 
>
>Any comments? 

When I've taught Stata in the classroom, I've always avoided -recode- 
because it seemed to kludgy, and taught the use of -int- (rather than 
-floor-, since the data were always positive - something I shouldn't have 
done.)

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