How to generate random numbers with a given lognormal distribution in R?

I would like to get 20 randomly generated numbers from a lognormal distribution with a geometric mean of 10 and a geometric standard deviation of 2.5.

What function R should be used to complete this task?

Thank you for your help!

+4
source share
1 answer

rlnorm function:

 rlnorm(20, log(10), log(2.5)) 

In general, distributions in R are usually available in forms d, p, q, r with the letters that appear first, followed by the distribution trunk: norm , lnorm , unif , gamma , ... etc. Their help pages will contain specifics of parameters that may be important when working with weibull or another distribution for which conventions are not completely standardized (as it were).

+11
source

Source: https://habr.com/ru/post/1380287/


All Articles