Announcement

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

  • Inverted Normal Graph

    Hello all,

    Admittedly a mundane question here... I'm simply trying to plot an inverted normal distribution for an upcoming presentation. I've successfully plotted a normal distribution, but now I simply need to flip it upside down.

    Code:
    clear
    set obs 100
    gen x=rnormal(0,1)
    twoway function y=normalden(x), range(-4 4) xtitle("{it: x}") ///
    ytitle("Density") title("Standard Normal")
    Any suggestions would be greatly appreciated! I recently converted to Stata from SPSS and apologies for presumably a rather elementary question!

    J.

  • #2
    What about just plotting y = 0.5 - normalden(x)? That looks OK to me, but maybe you want something different.

    Comment


    • #3
      Why 0.5?

      Comment


      • #4
        Code:
        twoway function y=normalden(x), range(-4 4)  yscale(reverse)
        Also, there is no need to generate an x variable before hand.

        Comment


        • #5
          Thanks Mike, worked perfectly!

          Comment


          • #6
            The choice of 0.5 came from observing that the maximum ordinate for the normalden() function was a little less than 0.5, so subtracting 0.5 would make all the values > 0.

            Comment

            Working...
            X