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

Re: st: code to round a continuous variable to the nearest 1/10th


From   Suzy <[email protected]>
To   [email protected]
Subject   Re: st: code to round a continuous variable to the nearest 1/10th
Date   Fri, 19 Aug 2005 12:41:50 -0400

Thanks Nick, I did see the round function, but Rich gave a bit more of a detailed example, which helped for my purposes.

Nick Cox wrote:

Note that -search round- points to on-line help on functions.
Nick [email protected]
Suzy



Thank you for the explicit code - I appreciate it!
Richard Goldstein


use the round function (e.g., gen x2=round(x1,.1))

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



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