1
$\begingroup$

I am looking to generate data for income by using lognormal distribution but unfortunately, I have only median of incomes. Do you have any idea how can I generate data for incomes or I should have also mean and std?

$\endgroup$

1 Answer 1

1
$\begingroup$

The Log Normal Distribution requires two parameters, $\mu$ and $\sigma^2$, be specified.

We note that:

The median is defined as $\text{exp}(\mu)$

Given that you have an estimate for the median - you can determine $\mu$ by taking the log of the median. However, you will then need to specify a value $\sigma^2$ in order to generate a random sample $X_1, \dots, X_n$ where $X_i \sim Lognormal(\mu, \sigma^2)$.

You could then use R or Python to generate some sample data. Here is an example of how to generate a sample using R.

# Specify mu and sigma
mu = 1
sd = 0.25

# Generate Sample
sample = rlnorm(10000, meanlog = mu, sdlog = sd)

# Calculate the estimated mean and median and compare against the five point summary.
mean = exp(mu + ((sd)^2)/2 )
median = exp(mu)

print(mean)
print(median)
summary(sample)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.