Announcement

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

  • Obtaining a graph of the interaction terms and marginal effects after xtreg, fe

    Hi all. I’d like to learn how to plot regression coefficients for the interaction terms AND marginal effects of these interactions (binary x continuous) after the xtreg command. I have tried to find handouts and other documentation on this matter on the web, to no avail.

    By using the dataset from Stata’s help command (see code below), can someone show how to do it?

    An example of the graph I would like to generate follows below, PANEL A on the left: Larsen, E. G. (2022). Dynamic political interest: How personality differences and the political environment shape political interest. British Journal of Political Science, 52(1).

    Thank you.

    PS: maybe the “coefplot” command from Ben Jann can do it, but I don’t know how.

    Code:
    webuse nlswork
    
    xtset idcode
    
    xtreg ln_w i.not_smsa age i.not_smsa#c.age ttl_exp i.not_smsa#c.ttl_exp tenure c.tenure#i.not_smsa south, fe
    Click image for larger version

Name:	figure_1.png
Views:	1
Size:	579.7 KB
ID:	1753231



  • #2
    For panel A, you are completely correct.
    Code:
    ssc install coefplot
    For panel B, marginsplot, after the margins command, is the way to go.

    Comment

    Working...
    X