Announcement

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

  • Limiting the y-axis on a marginsplot graph

    I'm creating a marginsplot graph for a probit model estimating predicted probabilities. Some of the confidence intervals are below 0 or above 1, which means the y-axis' range is from around -.5 to 1.5. I want to force the y-axis to range from 0 to 1. If I was making a regular twoway graph I would limit the range of observations using an if condition, but I'm not sure how to go about doing that for confidence intervals on a marginsplot graph.

    I've attached two pngs, one showing the graph without confidence intervals and one showing the graph with confidence intervals. Effectively, what I want is to display the confidence intervals, but have them cut off at 0,1 so that the y axis looks like the one in the graph without confidence intervals.
    Click image for larger version

Name:	With confidence intervals.png
Views:	1
Size:	64.3 KB
ID:	1585558
    Click image for larger version

Name:	Without confidence intervals.png
Views:	1
Size:	53.4 KB
ID:	1585559


    Any help is appreciated.
    Last edited by Ali Atia; 11 Dec 2020, 07:17.

  • #2
    See https://www.statalist.org/forums/for...ard-axis-range

    Comment


    • #3
      Thanks! Made a few small adjustments to your code in #5 to my fit my data and it works perfectly.

      Comment

      Working...
      X