Hello All,
I am starting to do more simulations and have a general question regarding simulating a lognormal distribution. I have existing data that looks like the following (I've fitted a lognormal curve to the data). I would like to simulate more data using the MLE estimated shape, scale and location parameters for the exisiting data. I noticed the RAND function does not support location, shape or scale for the lognormal distribution. How can I incorporate these parameters so that I can simulate data to look like my original data? I thought I could do Y = location parameter + scale parameter*X, where X =RAND("LOGNORMAL"). Am I on the right track here? Any help appreciated!!!
Chapter 7 of Wicklin (2013) Simulating Data with SAS has a section on "Adding Location and Scale Parameters" (p. 107-109).
For the lognormal function it says:
The RAND("Normal", mu, sigma) function generates X ~ N(mu, sigma). The random variable Y = exp(X) is
lognormally distributed with parameters mu and sigma..... Notice that the location and scale parameters are added before the
exponential transformation is applied.
You can add a threshold parameter by generating theta+Y.
For an example in teh DATA step, see "Simulate lognormal data with specified mean and variance."
Just for clarity, the embedded picture is from my acutal data. I would like to simulate more data that looks like this.
Look at the PDF('LOGNORMAL') function
Yes I will, thank you! I didn't think about using the pdf function.
Chapter 7 of Wicklin (2013) Simulating Data with SAS has a section on "Adding Location and Scale Parameters" (p. 107-109).
For the lognormal function it says:
The RAND("Normal", mu, sigma) function generates X ~ N(mu, sigma). The random variable Y = exp(X) is
lognormally distributed with parameters mu and sigma..... Notice that the location and scale parameters are added before the
exponential transformation is applied.
You can add a threshold parameter by generating theta+Y.
For an example in teh DATA step, see "Simulate lognormal data with specified mean and variance."
Hi Rick,
Thank you for the feedback! I understand now, and the link you provided with the example helps greatly.
Rick's blog might give you some help.
Thank you! This link is very helpful, Rick also referred to the same content on his blog. I appreciate your feedback!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.