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

RE: st: calling the value of a scalar into a variable


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   RE: st: calling the value of a scalar into a variable
Date   Mon, 06 Oct 2003 11:36:58 +0100

Stata users, 
 I have a small problem that I am sure can be solved by you experts. I am running some dickey fuller test, and computing my own Akaike Information criteria or Scharwtz Information Criteria. I saved the results of these in a scalar.
  I want to ask stata to create a variable that computes the minimum of the AIC or SIC and return the value in that variable, rather than me cheking it from the screen everytime.  Can anybody help please? I am copying the loop file below.

local z "1 2 3 4 5 6"

foreach x of local z{

regress D.netpremmean L.netpremmean L`x'D.netpremmean 
matrix   b`x'=get(_b)
scalar   AIC`x'=log(_result(4)/_result(1))+(colsof(b`x')/_result(1))*2
scalar   SIC`x'=log(_result(4)/_result(1))+(colsof(b`x')/_result(1))*log(_result(1))
}
scalar list


 So rather than calling  scalar list and looking at the screen, I want a variable that stores the min of  AIC and SIC so that I can see it in the data editor. I want to do that because at some point I would need to loop that over many series.

Please help.

many thanks
Dev




Dev Vencappa
School of Economics
University of Nottingham
University Park
Nottingham
NG7 2RD
U.K.
Tel : +44 (0)115 951 5608
Fax: +44 (0) 115 951 4159

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