Statalist


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

st: RE: Re: simple forvalues question


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: simple forvalues question
Date   Mon, 17 Dec 2007 18:20:05 -0000

In addition, your -if- is in the wrong place. 

varsoc pstrmon, maxlags(8) if cusip == `i'

should be 

varsoc pstrmon if cusip == `i', maxlags(8)

or 

varsoc pstrmon, maxlags(8), if cusip == `i'

Nick 
[email protected] 

Kit Baum

simple answer: there is no maxlags() option. From -help varsoc-,

     Main
       maxlag(#)                   set maximum lag order to #;  
default is maxlag(4)

Leave off the s and it should work!


> I would like to test the number of lags needed in a panel data set.
> Therefore, I use varsoc to test the number of lags for each time  
> series.
> But I would like to increase the number of max lags. How can I use  
> this
> as an option in the following code? Because the following does not  
> work,
> due to: , maxlags(8)
>
> forvalues i=1/108 {
> display "Calc number of lags pstrmon for CUSIP" `i'
> varsoc pstrmon, maxlags(8) if cusip == `i'
> more
> }

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