Announcement

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

  • a lognormal distribution fitting given empiric values (mean, 95th percentile)

    Hello I ask and help to draw a lognormally distributed variable from a given mean (5.3) and 95 percentiles (11.3)

  • #2
    I guess that the measures you quote are on a logarithmic scale and on that scale you have, or imagine having, a normal distribution, so that the standard deviation also on the same scale is taken to be


    Code:
    . di (11.3-5.3) / invnormal(.95)
    3.647741
    If draw means say show the density function on the original scale then you need to fire up twoway function with the formula for the lognormal distribution. But there are various interpretations of this question, including that you want instead the cumulative distribution function or the quantile function.

    Comment


    • #3
      Thanks Nick. No, the measures are on a natural scale. How can I transform them please? Mario

      Comment


      • #4
        The underlying normal distribution should be:
        gen assumed_normal=rnormal(5.3, 3.647741)

        How can I transform it in a lognormal distribution?

        Comment


        • #5
          I agree with Nick Cox in #2 that there are multiple ways to interpret your query. My interpretation was as follows.

          The mean and .95 percentile of a lognormal variable are
          Code:
          exp(mu + .5*s^2) and exp(mu + s*invnormal(.95))
          Setting these equal to 5.3 and 11.3, respectively, gives two equations in two unknowns. A little algebra and an application of the quadratic formula to solve for s gives (roughly)
          Code:
          mu = -2.03 and s = 2.72
          To draw a graph of the corresponding lognormal CDF, declare
          Code:
          loc mu = -2.03
          and
          Code:
          loc s = 2.72
          Then
          Code:
          tw function y=normal((ln(x)-`mu')/`s'), yline(.95) xline(11.3) ra(.01 15) ylab(.95 1, angle(360)) xlab(0 11.3) plotreg(marg(zero)) yti("f(y)", orient(horiz)) xti("y")

          Comment


          • #6
            A lognormal distribution is at its simplest a normal distribution exponentiated. (The terminology is in one sense backward but once introduced -- long after the distribution was thought about -- it became established quite quickly so far as I can judge.)

            Comment


            • #7
              thank you both prof. John and prof. Nick. mario

              Comment

              Working...
              X