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 <>
To   "Stata Listserve" <>
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. 

>My favourite is none of these but 
>	5 * floor(mpg/5) 

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

>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 

*   For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index