Announcement

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

  • Graph of multiple coefficients

    Hello all,

    I have estimated an age-period-cohort model:

    reg y ib1.age year_3-year_n ib1.cohort

    This is a simplification of the model, where age is a factor variable indicating the age, year_i are dummies of the years (periods), and cohort is a factor variable of the cohorts.
    Now I want to make a graph of the all age coefficients, all year coeffients and all cohort coefficients, as in Tunali et al. (2017):

    Click image for larger version

Name:	graph tunali.png
Views:	1
Size:	64.8 KB
ID:	1482668


    In addition, I also want to have the confidence intervals in the graph. How do I make a graph of multiple coefficients from one regression?

  • #2
    See -margins- and -marginsplot-
    For example:

    Code:
    sysuse auto,clear
    reg price c.mpg c.weight
    margins, at(mpg =(10(2)50)) atmeans
    marginsplot, recastci(rline) name(gr1,replace)
    margins, at(weight = (1500(250)5000)) atmeans
    marginsplot, recastci(rline) name(gr2,replace)
    graph combine gr1 gr2,row(1)
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	48.4 KB
ID:	1482702

    Comment


    • #3
      Thank you very much for you response!

      Unfortunately, this does not exactly solve my problem completely. I do not want to do any post-regression estimation. I only want to use the actual coefficients from the regression and not estimate the margins first. Maybe you (or anyone else) also know how I can do this?

      Comment


      • #4
        Your example graphs display predicted values, however, if you just want to plot the estimated coefficients I would take a look Ben Jann's -coefplot -(ssc desc coefplot-).


        Comment

        Working...
        X