Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: Using -estadd scalar- to add scalar to -esttab- table, but can't display -pperron- scalar


From   Richard Herron <richard.c.herron@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Using -estadd scalar- to add scalar to -esttab- table, but can't display -pperron- scalar
Date   Wed, 21 Dec 2011 16:16:52 -0500

I am using -estadd- and -esttab- from the -estout- package (-ssc
install estout-) to create tables in a -foreach- loop.

But I can't display a scalar p-value output from -pperron- (base Stata
11.2) that I add with -estadd scalar-, although I can display a scalar
p-value output from -dfuller- (base Stata 11.2) that I add with
-estadd scalar-. From the output, it looks like the -pperron- p-value
is being added to the -eststo- object, but I can't display it with
-esttab, stats(p_pperron)-.

I have tried different ordering of the -dfuller- and -pperron- calls,
different names for the stored -e()- scalar, and passing through an
intermediate scalar step, but all have failed. The following code
reproduces the problem of failing to display the -pperron- scalar
p-value. Thanks!


webuse lutkepohl, clear

* unit root tests in logs
global unit_root_log linvestment lincome lconsumption
foreach x of varlist $unit_root_log {
    eststo clear

    * trend and one lag
    eststo, title(ADF w/ trend) ///
        : quietly regress d.`x' qtr l.`x' ld.`x'
    dfuller `x', trend lags(1)
    estadd scalar p_dfuller = r(p)
    pperron `x', trend lags(1)
    estadd scalar p_pperron = r(p)

    * one lag
    eststo, title(ADF w/o trend) ///
        : quietly regress d.`x' l.`x' ld.`x'
    dfuller `x', lags(1)
    estadd scalar p_dfuller = r(p)
    pperron `x', lags(1)
    estadd scalar p_pperron = r(p)

    * one lag and no constant
    eststo, title(ADF w/o trend, int.) ///
        : quietly regress d.`x' l.`x' ld.`x' ///
        , noconstant
    dfuller `x', noconstant lags(1)
    estadd scalar p_dfuller = r(p)
    pperron `x', noconstant lags(1)
    estadd scalar p_pperron = r(p)

    * table
    esttab, compress nogaps ///
        stats(aic bic rss p_dfuller p_pperron N) order(_cons qtr) ///
        label mtitles nostar
    esttab using unit_root_`x'.tex ///
        , stat(aic bic rss p_dfuller p_pperron N) order(_cons qtr) ///
        replace booktabs label mtitles nostar
}
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index