[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: rounding in STATA
Dear Stata-listers
I have a minor issue with the way STATA is rounding, for example a
variable to one decimal place.
I used the command
gen x=round(y, 0.1)
Comparing the two variables, I noticed the that when:
x= y=
8.750 8.7
5.752 5.8
23.256 23.3
Is there a way I can modify the function to round "x"=8.750 to be 8.8
Or should I put together my own code to get the rounding I want.
Many thanks in advance...
Amani
*
* 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/