Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Strange problem with forvalues


From   "Nuno" <[email protected]>
To   <[email protected]>
Subject   st: Strange problem with forvalues
Date   Fri, 22 Feb 2008 17:47:10 -0000

Hi everone,

I'm having an issue with Stata and a small routine I've written. The code is
the following:

forvalues j=.1(.1).9{
statsby _b,  by(year) saving(c:\qreg`j'.dta, replace):  qreg y x1 x2 x3 x4,
quantile(`j')
}

The objective run the qreg for the deciles .1-.9 and get save the
coefficient estimates in a file. The problem is that, when Stata reaches
quantile .8 and .9 it seems to assum that j=.7999999999999 or
j=.89999999999. This doesn't happen with the other js.

      command:  qreg y x1 x2 x3 x4, quantile(.7999999999999999)
           by:  year
(note: file c:\qreg.7999999999999999.dta not found)

Statsby groups
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
................
(running qreg on estimation sample)

      command:  qreg y x1 x2 x3 x4, quantile(.8999999999999999)
           by:  year
(note: file c:\qreg.8999999999999999.dta not found)

Statsby groups
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
................

If I then restart the code with j=.8(.1).9 everyhing runs fine. Any ideas
for this to happen?

Best,

Nuno

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