Announcement

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

  • Right way to extract Confidence Intervals of coefficients of interaction term

    Dear all,

    I was wondering about what would the right way to form a list or matrix or a variable (either of them would work for me) of confidence intervals of the coefficients of the interaction term treat#ib2005.year from the regression:

    regress index treat i.id ib2005.year treat#ib2005.year, vce(cluster id) (2005 is the base year)

    I am aware of the command - _b[foreign] - invttail(e(df_r),0.025)*_se[foreign] to generate the 95% lower bound and using + to generate upper bound. However, how to specify the interaction term in place of "foreign"?

    I want to form a list or matrix of confidence intervals for all 10 coefficients (corresponding to 10 years) of treat#ib2005.year.

    What is the right way to do that?

    Thanks in advance!

  • #2
    After running your regress command to fit your model, run the command
    Code:
    regress coeflegend
    to learn the names of the coefficients, including those of the interaction terms. Then notice that in the output of
    Code:
    help regress postestimation
    the lincom command seems to do the calculations you want, so perhaps the output of
    Code:
    help lincom
    will start you in a useful direction to producing your desired output.

    Comment


    • #3
      In addition, have a look at r(table) after your estimation command.
      Code:
      mat list r(table)
      This already contains confidence intervals for each parameter so you would only need to extract them.

      Comment


      • #4
        Thank you very much William. I used to think that lincom was supposed to be used only after svy setting the data. I had no idea it could be used without it too. Thanks!

        Comment


        • #5
          Thank you so much Wouter. I was aware of r(table) but I didn't know what to do with that list . So I did matrix c = r(table) and then extracted what I wanted from here.

          Comment

          Working...
          X