Announcement

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

  • Create Cofficient Plot

    Hi all,

    Apologies I do not have a data extract for this.

    What code could I write to generate the picture attached?

    The Y-axis represents the magnitude of each coefficient. The X-axis is a different lag of the same regressor.

    What would also be fine is for each lag, get a point estimate with 95% confidence bands, and link all of these with a curve which passes through the point estimate at each lag.

    Thanks!
    Attached Files

  • #2
    I don't think the authors plotted the raw coefficients. It seems like some sort of smoothing has been applied. Here is some way, using a quadratic prediction plot.

    Code:
    webuse sp500, clear
    tsset date
    frame create results lag coef
    foreach lag of numlist 1 4 6{
        regress close L`lag'.volume
        frame post results (`lag') (_b[L`lag'.`volume'])
    }
    frame results{
        twoway qfit coef lag, sort ytitle(Coefficient)
    }
    frame drop results
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	20.1 KB
ID:	1744321

    Comment


    • #3
      As usual Andrew, your response is very helpful & instructive! Thanks! I will try to apply and let you know of the outcome.

      Comment


      • #4
        #2 worked perfectly, thanks again!

        Comment

        Working...
        X