Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Francis, Richard N" <rnfrancis@utep.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: SROOT program - test seasonal unit root |
Date | Wed, 30 Oct 2013 01:36:33 +0000 |
Nick, I am most grateful for your insight. Apologize for the misspelling, and for the hassle. Thank you again!! Rick Francis -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox Sent: Tuesday, October 29, 2013 7:29 PM To: statalist@hsphsun2.harvard.edu Subject: Re: st: SROOT program - test seasonal unit root That su group, meanonly should be su id, meanonly Nick njcoxstata@gmail.com On 30 October 2013 01:27, Nick Cox <njcoxstata@gmail.com> 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 > njcoxstata@gmail.com > > > On 30 October 2013 01:07, Francis, Richard N <rnfrancis@utep.edu> 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/ * * 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/