Announcement

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

  • standard errors for sum of ols coefficient

    I want o estimate the standard errors for sum of OLS coefficient. What would be the formula?

    Let's say I have a model
    Code:
    reg y x1 x2 x1*x2 x3
    and I want to estimate the standard errors of (b2 + b3), where b1 is coefficient on x2 and b2 on x1*x2.

    How to proceed?

  • #2
    Well, first let's get the model code right: you can't have x1*x2 as a term in the -reg- command.

    Code:
    reg y x1##x2 x3
    (If x1 or x2 is continuous, then a c. prefix is needed in front of it.)

    The sum of the coefficients of x2 and the x1#x2 interaction is then
    Code:
    lincom 1.x2 + 1.x1#1.x2
    (I'm assuming x1 and x2 are 0/1 variables If they are coded differently, then the -lincom- statement needs corresponding modification.)

    Moreover, if you are computing this sum because you are looking for the marginal effect of x2 conditional on x1 = 1 you can also get it from

    Code:
    margins, dydx(x2) at (x1 = 1)

    Comment


    • #3
      Also, I think using the coefl option can help so you get the coefficient names right, e.g.

      Code:
      sysuse auto, clear
      reg price i.foreign weight i.foreign#c.weight, coefl
      lincom _b[weight] + _b[1.foreign#c.weight]
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Clyde, Richard

        Thank you very much for replies!

        Comment

        Working...
        X