Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • dfuller regression results

    Hi, I am relatively new to stata and am currently trying to run the dfuller unit-root test with regression and trend on a panel/time-series of different minerals.
    While looping over the respective panels results in the desired output (see below example for panel "Arsenic") I am wondering how I can access the individual results.
    In my case I would like to extract from each regression table the coefficient for _trend (and its p-value).
    However, according to Stata dfuller only stores the following results:

    ----------------
    dfuller stores the following in r():

    Scalars
    r(N) number of observations
    r(lags) number of lagged differences
    r(Zt) Dickey-Fuller test statistic
    r(p) MacKinnon approximate p-value (if there is a constant or trend in associated regression)
    ----------------

    If anyone has an idea how to access the other results as well I would be very thankful (I want to store these results in a matrix while looping over all the minerals).

    Cheers,

    Alex
    Click image for larger version

Name:	Screen Shot 2017-04-20 at 1.48.43 PM.png
Views:	1
Size:	31.3 KB
ID:	1384593





  • #2
    Do not post screenshots in the future. Refer to the FAQs on the proper way to post Stata output. You can run the equivalent regression and pick out the coefficient of the time variable from there (I denote it with "t" below). Stata does not store p-values, but these are easy to calculate if you have the t-statistics.


    Code:
    quietly regress rpr_r L1.rpr_r t
    scalar t= _b[t]/_se[t]
    di _b[t]
    di _se[t]
    scalar tstat= _b[t]/_se[t]
    di tstat
    scalar pvalue = (2 *ttail(e(df_r), abs(tstat)))
    di pvalue

    Comment

    Working...
    X