Statalist


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

st: AW: forvalues i = 0(.05).15


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: forvalues i = 0(.05).15
Date   Mon, 9 Nov 2009 15:58:11 +0100

<> 

Big fun to play around with this:

*************
forv i = 0(.025)0.15 {
	di in r `i' _col(10) float(`i')
}

forv i = 0(.005)0.15 {
	di in r `i' _col(10) float(`i')
}
*************

Probably related to the issues in [U], 13.11., and Nick`s SJ tip
http://www.stata-journal.com/sjpdf.html?articlenum=dm0022



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von David Airey
Gesendet: Montag, 9. November 2009 15:51
An: Statalist
Betreff: st: forvalues i = 0(.05).15

.

The fact that forvalues

forvalues i = (0)(.05).15 {
display `i'
}

gives


. forvalues i = 0(.05).15 {
   2. display `i'
   3. }
0
.05
.1

is related to accuracy of a macro or float right (.15 is missing)?

I could alternatively type:

forvalues i = 0(5)15 {
display `i'/10
}

or

forvalues i = 0(.05).16 {
display `i'
}


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


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