Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: SROOT program - test seasonal unit root


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: SROOT program - test seasonal unit root
Date   Wed, 30 Oct 2013 01:29:29 +0000

That

su group, meanonly

should be

su id, meanonly

Nick
[email protected]


On 30 October 2013 01:27, Nick Cox <[email protected]> wrote:
> The problem lies in your -foreach- loop which executes -sroot- just
> once, as you do not specify otherwise.
>
> You should try something like
>
> egen id = group(gvkey1)
> su group, meanonly
>
> forval i = 1/`r(max)' {
>      sroot fcf if id == `i'
> }
>
> See also
>
> http://www.stata.com/support/faqs/data-management/try-all-values-with-foreach/
>
> (Spelling is Stata!)
>
> Nick
> [email protected]
>
>
> On 30 October 2013 01:07, Francis, Richard N <[email protected]> wrote:
>> Through the generosity of The STATA Journal, I was able to acquire a program which performs a test of seasonal unit roots (program name is sroot, v9 of The Stata Journal).
>>
>> For a sample with one subject and say 60 obs, the program works like a dream!
>>
>> However, my sample contains multiple subjects, so instead of executing the program separately for each subject, I attempted to use the "foreach" command/routine, and received the following:
>>
>> foreach v in gvkey1 {
>>   2. sroot fcf
>>   3. }
>> sample may not include multiple panels
>>
>> Obviously, the program was designed for the single subject in mind (and don't get me wrong, I am most grateful for the availability of the single subject program!).
>>
>> My question is whether anyone may have a suggestion for working around the multiple panel problem.
>>
>> I am a SAS user, who finds plenty of shortcomings with SAS, and finds many features of STATA to be pretty cool.
>>
>> Thank you for any ideas you may have!!
>>
>> Rick Francis
>>
>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index