Announcement

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

  • Plotting marginal effects (lines) that are not in the same vertical line

    Dear all,

    After running a multilevel regression, I intend to plot the marginal effects corresponding to four categories that represent different types of higher education finance. My dependent variable is a dichotomous variable that represents, for highly-educated adults, the probability of attaining a MA level degree, instead of a BA level one. I am trying to assess to what extent the effect of father's education on the probability of attaining a MA-level degree instead of a BA-level degree diverges across types of higher education finance. The variable that captures these types of higher eduction finance is GARRITZMANN TYPE in the following model:

    Code:
    xtmelogit master female age i.edufath##GARRITZMANN_TYPE_2 || cntryid3:
    I then ask for the marginal effects and generate the corresponding graph:

    Code:
    margins edufather, at(GARRITZMANN_TYPE_2 ==(1 2 3 4)) predict(mu fixedonly) vsquish level(90) post
    marginsplot
    Click image for larger version

Name:	Garritzman_MA.png
Views:	1
Size:	33.4 KB
ID:	1528561

    Then, I edit the graph and suppress the lines that connect the markers for each category of father's education in the variable capturing the typology of higher education finance. This is the result

    Click image for larger version

Name:	Garritzman_MA2.png
Views:	1
Size:	29.2 KB
ID:	1528560


    Would it be possible to have the lines marking the predictive margins for each category of father's education so that they are not EXACTLY in the same vertical line; that is, separated enough so that I can visualise them better?. Instead of being them all in a single vertical line, I would like the markers and their confidence intervals to be slightly separated from each so other, enough to see the degree to which they overlap between each other.

    I have tried with the graph editor, and looking at the marginsplot help, but I have not managed to find the solution

    I do appreciate your attention

    Kind regards

  • #2
    See Nick Winter's -mplotoffset-

    Code:
    . ssc desc mplotoffset
    
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    package mplotoffset from http://fmwww.bc.edu/repec/bocode/m
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    TITLE
          'MPLOTOFFSET': module to produce marginsplots with offset plotting symbols
    
    DESCRIPTION/AUTHOR(S)
          
           Produces marginsplot with each plot offset horizontally to allow
          clearer viewing of plotting symbols and especially confidence
          intervals.

    Comment


    • #3
      Great....¡¡

      Many thanks, Scott.

      All the best

      Luis

      Comment

      Working...
      X