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: How to generate a table with the outcomes of unit-root tests from unbalanced panel?


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: How to generate a table with the outcomes of unit-root tests from unbalanced panel?
Date   Fri, 18 Nov 2011 07:44:40 +0000

On the use of the word "macro", see

http://www.stata.com/statalist/archive/2008-08/msg01258.html

On guidance on looping, see

FAQ     . . . . . . . . . . Making foreach go through all values of a variable
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        8/05    Is there a way to tell Stata to try all values of a
                particular variable in a foreach statement without
                specifying them?
                http://www.stata.com/support/faqs/data/foreach.html

SJ-2-2  pr0005  . . . . . .  Speaking Stata:  How to face lists with fortitude
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        Q2/02   SJ 2(2):202--222                                 (no commands)
        demonstrates the usefulness of for, foreach, forvalues, and
        local macros for interactive (non programming) tasks


On Fri, Nov 18, 2011 at 5:52 AM, Yuval Arbel <[email protected]> wrote:
> I believe what I need is to construct a macro with -foreach- command
> and for each appt number to carry out the -dfuller- command.
> However, I don't know how exactly to construct such a macro. Can you assist me?
>
> On Thu, Nov 17, 2011 at 5:58 PM, Austin Nichols <[email protected]> wrote:
>> Yuval Arbel <[email protected]>:
>> I doubt you really want -dfuller- output.  You should read at minimum:
>> http://www.econ.cam.ac.uk/faculty/pesaran/lm.pdf
>> http://www.econ.cam.ac.uk/faculty/pesaran/wp11/Interpretation-Panel-Unit-September-2011.pdf
>> and see especially the lit review in the second for recent work.
>>
>> On Thu, Nov 17, 2011 at 10:05 AM, Muhammad Anees <[email protected]> wrote:
>>> -Dfuller- runs regression where the Z(t) is the coefficient of the
>>> estimated lagged Dep.Var with D.(Dep.Var) as the dependent variable.
>>> Using the estout option after the regress command could do what you
>>> want.
>>>
>>> example is give from my results
>>>  energyusekt |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
>>> -------------+----------------------------------------------------------------
>>>  energyusekt |
>>>         L1. |   .0349052   .0078295     4.46   0.000      .018976    .0508345
>>>             |
>>>       _cons |   384.8409   365.0711     1.05   0.299    -357.9018    1127.584
>>> ------------------------------------------------------------------------------
>>>
>>> . estimates store a
>>>
>>> . esttab
>>>
>>> ----------------------------
>>>                      (1)
>>>             D.energyus~t
>>> ----------------------------
>>> L.energyus~t       0.0349***
>>>                   (4.46)
>>>
>>> _cons               384.8
>>>                   (1.05)
>>> ----------------------------
>>> N                      35
>>> ----------------------------
>>> t statistics in parentheses
>>>
>>> Now using other Stata tools, it can easily be exported.
>>> regress d.energyusekt l.energyusekt
>>> On Thu, Nov 17, 2011 at 7:49 PM, Yuval Arbel <[email protected]> wrote:
>>>> Dear statalist participants,
>>>>
>>>> I have an unbalanced panel of apartments, which contains 9,547 apartments.
>>>>
>>>> I ran the following commands:
>>>>
>>>> . tsset t
>>>>        time variable:  t, 1 to 507798
>>>>                delta:  1 unit
>>>>
>>>> . dfuller reduct_per if appt==2851
>>>>
>>>> Dickey-Fuller test for unit root                   Number of obs   =        27
>>>>
>>>>                               ---------- Interpolated Dickey-Fuller ---------
>>>>                  Test         1% Critical       5% Critical      10% Critical
>>>>               Statistic           Value             Value             Value
>>>> ------------------------------------------------------------------------------
>>>>  Z(t)             -0.891            -3.736            -2.994            -2.628
>>>> ------------------------------------------------------------------------------
>>>> MacKinnon approximate p-value for Z(t) = 0.7910
>>>>
>>>> . dfuller reduct_per if appt==2862
>>>>
>>>> Dickey-Fuller test for unit root                   Number of obs   =        37
>>>>
>>>>                               ---------- Interpolated Dickey-Fuller ---------
>>>>                  Test         1% Critical       5% Critical      10% Critical
>>>>               Statistic           Value             Value             Value
>>>> ------------------------------------------------------------------------------
>>>>  Z(t)             -6.784            -3.668            -2.966            -2.616
>>>> ------------------------------------------------------------------------------
>>>> MacKinnon approximate p-value for Z(t) = 0.0000
>>>>
>>>> . dfuller reduct_per if appt==2906
>>>>
>>>> Dickey-Fuller test for unit root                   Number of obs   =        94
>>>>
>>>>                               ---------- Interpolated Dickey-Fuller ---------
>>>>                  Test         1% Critical       5% Critical      10% Critical
>>>>               Statistic           Value             Value             Value
>>>> ------------------------------------------------------------------------------
>>>>  Z(t)             -1.313            -3.518            -2.895            -2.582
>>>> ------------------------------------------------------------------------------
>>>> MacKinnon approximate p-value for Z(t) = 0.6233
>>>>
>>>> . dfuller reduct_per if appt==2907
>>>>
>>>> Dickey-Fuller test for unit root                   Number of obs   =       103
>>>>
>>>>                               ---------- Interpolated Dickey-Fuller ---------
>>>>                  Test         1% Critical       5% Critical      10% Critical
>>>>               Statistic           Value             Value             Value
>>>> ------------------------------------------------------------------------------
>>>>  Z(t)             -2.647            -3.509            -2.890            -2.580
>>>> ------------------------------------------------------------------------------
>>>> MacKinnon approximate p-value for Z(t) = 0.0836
>>>>
>>>> Now, I would like to produce a table where for each apartment I attach
>>>> the full output of dfuller
>>>>
>>>> I wonder, how can I produce such a table in a way that it can be
>>>> exported in xls. or csv. formats:
>>>>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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