BookmarkSubscribeRSS Feed
HS2
Fluorite | Level 6 HS2
Fluorite | Level 6

Hello,

If I have a variable X with N observations and Min and Max values, how can I find the parameters of a log normal distribution that fits X's distribution?

 

Thanks

1 REPLY 1
Stu_SAS
SAS Employee

PROC SEVERITY will estimate the distribution of data and give you the closest estimates. You can choose the distributions you'd like it to estimate and it will identify the most likely distribution and its estimates. Since you know it's log normal, you can tell it to estimate only the parameters of a log normal distribution.

 

Let's simulate a lognormal distribution with Mu=0 and Sigma=0.5:

data logn;
    call streaminit(12345);
    do i = 1 to 10000;
        x = rand('lognormal', 0, 0.5);
        output;
    end;
run;

Stu_SAS_7-1676642251308.png

 

 

Next, let's use PROC SEVERITY to estimate the parameters of this distribution assuming we know it is log normal.

proc severity data=logn;
    loss x;
    dist logn;
run;

Stu_SAS_4-1676641801164.png

 

While not perfect, it's pretty close at getting the right answer: Mu is very close to 0, and Sigma is within about 0.004 decimal points of the true value. 

 

Stu_SAS_2-1676641757917.png

Let's say you didn't know the distribution. You can test a variety of distributions, including custom distributions, with PROC SEVERITY. 

proc severity data=logn;
    loss x;
    dist _ALL_;
run;

Stu_SAS_5-1676642115886.png

Even after testing all of these distributions, it still is able to determine that x is most likely log normal.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1045 views
  • 1 like
  • 2 in conversation