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

st: RE: Re: retrieving the results from DFGLS


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: retrieving the results from DFGLS
Date   Fri, 17 Oct 2003 14:49:48 +0100

Dev Vencappa
 
>  I have a small problem within a loop. I have estimated a 
> variable using the command dfgls
> 
> dfgls variable1
> 
> I saved the lag order at the minimum of the MAIC into a scalar
> 
> scalar x=r(maiclag)
> 
> * and I saved all the statistics into a matrix
> 
> matrix y=r(results) 
> 
> Now I want to be able to retrieve the DFGLS statistic from 
> matrix y if the value of the lag k within that matrix 
> equals the value of the scalar x and call both into a 
> variable that I can see within the data editor
> 
> I am not conversent with calling matrix values in stata. 
 
My suggestion is: don't do it this way. 
It is not quite painting yourself into 
a corner, but it makes life more difficult
than is necessary. 

If you want to use your results as if they 
were a further dataset, which is natural
and common, set them up so they really 
do become a new dataset. Stata matrices
don't really lend themselves to the 
kind of thing you want. It is possible, 
but you will end up writing lots of 
little programs to implement trivial 
one-off tasks. 

So, starting from where you are, the 
best advice might be to get the values
out of that matrix into new variables
with -svmat-. 

Nick 
[email protected] 
*
*   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