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 user written pgm


From   "Francis, Richard N" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: sroot user written pgm
Date   Mon, 4 Nov 2013 21:08:38 +0000

Nick,

Most grateful for your insight, your suggestions work beautifully!

Any thoughts on obtaining the test statistics from the user written pgm for further analysis (such as separating significant and insignificant results)?

Again, I am grateful for the assistance available from you and the Statalist in general.

Rick Francis
Associate Professor
Department of Accounting
College of Business Administration
University of Texas at El Paso
500 W. University Avenue
El Paso, TX  79968
Office: 915-747-7953
FAX: 915-747-8618
Email:  [email protected]

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: Monday, November 04, 2013 5:52 AM
To: [email protected]
Subject: Re: st: sroot user written pgm

Second -preserve- should be -restore-.
Nick
[email protected]


On 4 November 2013 10:57, Nick Cox <[email protected]> wrote:
> You are asked in the Statalist FAQ (a) to explain where user-written 
> programs you refer to come from (b) not to send attachments to the 
> list.
>
> With your data, -tsset gvkey obsno, quarterly- fails because -gvkey- is string.
>
> You would be better using a proper quarterly date:
>
> gen date = yq(year, fqtr)
> tsset id date
>
> But your main problem appears to be that -sroot- (SJ) does not support
> -if- correctly.  You should contact the author.
>
> A work around is this:
>
> egen id = group(gvkey), label
> gen date = yq(year, fqtr)
> tsset id date
>
> su id, meanonly
>
> forval i = 1/`r(max)' {
>              preserve
>              keep if id == `i'
>              sroot fcf
>              preserve
> }
>
> Nick
> [email protected]
>
>
> On 4 November 2013 03:28, Francis, Richard N <[email protected]> wrote:
>
>> Anyone know if a user written program such as "sroot" (seasonal unit root test) is capable of looping such that the program tests the time series for each subject in the sample?
>>
>> I attached a sample with three subjects, 60 obs each.
>>
>> Then used the following pgm:
>>
>> tsset gvkey obsno, quarterly
>>
>> egen id = group(gvkey)
>> su id, meanonly
>>
>> foreach i of num 1/`r(max)' {
>> sroot fcf if id == `i'
>> }
>>
>> Program runs, but pools the subjects rather than test them individually.
>>
>> I am grateful for any ideas here.
*
*   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