Announcement

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

  • Entering sum of coefficients hypothesis test in a regression table

    Hi All,

    I have data that resembles the following:


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(y x time)
    213 321  1
     23   3  2
      2   2  3
      2   1  4
      1   2  5
      3   3  6
      1   2  7
      2   3  8
      3   1  9
      2   2 10
    end
    Here, I have data for y and x, by year. I first declare the data as time series using the -tsset- command. Thereafter, I run a simple regression as follows:
    Code:
    regress y x L.x
    I normally export the regression to LaTex using the -esttab- class of commands as follows

    Code:
    esttab using "table1.tex", scalar(F) varwidth(25) keep(x L.x ) star(+ 0.15 * 0.10 ** 0.05 *** 0.01) p  label replace
    What I wish to do now is to include an additional row (without typing out the results by hand in Latex), that performs a simple hypothesis test of the null:

    H0: beta1+beta2=0
    HA: not H0

    I could implement this on Stata quite simply as:

    Code:
    test x= -L.x
    However, instead of just providing the p-value of this test statistic, I would like the sum of the coefficients along with the standard error of the sum displayed as well. Is there a simple way to do this?

    Many thanks,
    CS

  • #2
    I think you can modify this example easily:

    https://www.statalist.org/forums/for...cance-stars-to lincom-in-esttab?p=1466698#post1466698

    Comment


    • #3
      Awesome, Dimitriy V. Masterov . Very helpful.

      Comment

      Working...
      X