Announcement

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

  • graphing regression outputs


    Hello All,

    I am looking to get some assistance please; I am seeking info on producing graphs in Stata, following regressions.

    Consider a dependent variable of company growth, independent variables such as assets and wages - all continuous variables.
    After running a regression like : regress growth assets wages variableX variableY,
    I would to be able to do the following:

    (A) display growth on the y-axis and display both assets and wages on the x-axis (two separate curves that can allow comparison of both the assets-growth and the wages-growth relationships in the same graph)

    (B) display a moderating relationship - that is, how a categorical variable such as CompanyStage moderates the assets-growth relationship. Here, growth will be on the y-axis while assets will be on the x-axis. The graph will have 2 curves - one curve showing the assets-growth relationship of stage1 companies, and the second curve on the same graph will show the assets-growth relationship of stage2 companies. CompanyStage will be a dichotomous dummy variable (stage1 =0; stage2 = 1)

    The regression command before the graphs will be such as the following:

    regress growth assets wages assets*stage1 assets*stage2

    Can you please assist?

    Thank you!

    K

  • #2
    I think you're looking for Ben Jann's programme coefplot. Type

    Code:
    ssc install coefplot //then read:
    help coefplot

    Comment


    • #3
      For (B), -margins- followed by -marginsplot- will do this for you. While the manual section on -margins- is good and has lots of worked examples, I think a simpler introduction to this very versatile and powerful command is through Richard Williams' wonderful article in the Stata journal, http://www.stata-journal.com/sjpdf.h...iclenum=st0260, which covers the basics of it. Of course, to avail yourself of it, you will have to use factor variable notation. If you are not familiar with that, see -help fvvarlist-.

      For (A), I do not know what to suggest. You can do something like -graph twoway line growth assets || line growth wages, sort- to get to such graphs in the same picture. But unless the scales of growth and assets are such that the distributions of their numerical values are rather similar, you are likely to find two curves sitting side-by-side in the graph, and quite possibly with one of them scrunched up at one edge, and then an empty space leading then to the second graph, which fills out the rest of the plot. I can't think of a way to do this that has a good chance of producing usable results. It is not uncommon to have graphs with dependent variables, each associated to its own vertical axis, but graphs with separate horizontal axes I have not seen.

      Comment

      Working...
      X