Announcement

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

  • Plot normal cdf

    Hi all, can anybody help me with the command to plot a cdf for a normal distribution?
    Thanks

  • #2
    Code:
    twoway function y = normal(x), range(-4 4)
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Fantastic! One more question, what about a cdf for a normal distribution with a specific mean and variance?

      Comment


      • #4
        here is an example with a mean of +3 and a variance of .5, so a standard deviation of \( \sqrt{.5} \) :

        Code:
        twoway function y = normal((x-3)*sqrt(.5)), range(-4 4)
        Last edited by Maarten Buis; 01 Jun 2016, 01:46.
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Thanks Maarten, I am a little confused as to when when I use your code with mean=24, and SD=8, the cdf is very steep about the mean, which is odd given the SD, and given the same cdf in Wolfram Alpha looks a lot more accurate, are you able to help/explain this? I have searched a lot online with no avail...Thanks!

          Comment


          • #6
            If you do not tell us exactly what you typed, then we cannot tell you what your mistake is.
            ---------------------------------
            Maarten L. Buis
            University of Konstanz
            Department of history and sociology
            box 40
            78457 Konstanz
            Germany
            http://www.maartenbuis.nl
            ---------------------------------

            Comment


            • #7
              The mistake was mine, you need to divide by the standard deviation, not multiply.

              Code:
              twoway function y = normal((x-24)/8), range(0 48)
              ---------------------------------
              Maarten L. Buis
              University of Konstanz
              Department of history and sociology
              box 40
              78457 Konstanz
              Germany
              http://www.maartenbuis.nl
              ---------------------------------

              Comment

              Working...
              X