Announcement

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

  • Adding x axis label to graph

    Hi -I am using the margins command to interpret a three-way interaction. However, the graph seems to omit the x axis labels for the first graph ("year=0"). Is there anyway of telling Stata to keep all x axis labels (no/yes) for the three graphs?

    Code:
    margins year, at(femployment_=(0 1) price=(0 1)) noestimcheck
    mplotoffset,recast(scatter)offset(0.1) by(year)
    Click image for larger version

Name:	Graph two.png
Views:	1
Size:	64.1 KB
ID:	1604404

  • #2
    If your command is a wrapper for marginsplot, then add

    Code:
    byopts(ixaxes)

    As always, if you are referencing a non-official Stata command, you need to tell us where it is from (FAQ Advice #12).

    Comment


    • #3
      Thank you, Andrew. That fixes it, and noted for the future (re Stata commands).

      Comment


      • #4
        That's by design, but it should be easy enough to reverse. Consider this series:

        Code:
        sysuse nlsw88, clear
        scatter wage hours, by(race)
        scatter wage hours, by(race, ixaxes)
        However, mplotoffset is community-contributed (from SSC), as you are asked to explain and I haven't used it, and there is no example data here. At a wild guess adding

        Code:
        byopts(ixaxes) 
        might just work. If not, sorry about that, and you need other ideas.

        Comment


        • #5
          Thank you, Nick. Luckily byopts does work with mplotoffset:

          Code:
          mplotoffset,recast(scatter)offset(0.1) by(year) byopts(ixaxes)
          And produces the following graph:

          Click image for larger version

Name:	Graph two.png
Views:	1
Size:	72.3 KB
ID:	1604416

          Comment


          • #6
            You probably have enough space there to insist on one row of plots, in which case the problem would not arise to be overcome.

            Comment

            Working...
            X