0
$\begingroup$

I know the mean and standard deviation of a population, and its minimum and maximum value.

How can I generate each data value from those parameters (using R) with the assumption that the data is normally distributed?

"rnorm" function in R can generate the data but it can not reflect the exact mean and standard deviation. Also, the data generated can be outside of the range between minimum and maximum value.

$\endgroup$
3
  • 4
    $\begingroup$ Are the min/max values the lowest/highest values that you've observed in the population, or the lowest/highest values that are possible in the distribution? $\endgroup$
    – Ian_Fin
    Commented Oct 4, 2016 at 9:52
  • 2
    $\begingroup$ ""rnorm" function in R can generate the data but it can not reflect the exact mean and standard deviation." You might want to try mvrnorm which has an "empirical" argument. $\endgroup$
    – Silverfish
    Commented Oct 4, 2016 at 9:59
  • 1
    $\begingroup$ If it has a minimum or maximum it cannot be normal which has its support on the real line. $\endgroup$
    – mdewey
    Commented Oct 4, 2016 at 10:33

1 Answer 1

0
$\begingroup$

As mdewey's comment pointed, if the distribution has a minimum and a maximum it's not normal. However, it can be a truncated normal distribution, which is close to normal but has minimum and maximum. In R you can generate a random sample from a truncated normal with the truncnorm package.

And about your statement that rnorm "can generate the data but it can not reflect the exact mean and standard deviation" beware that sample mean and sample standard distribution (and sample maximum and minimum) aren't exactly the same of the population. They just converge to those of the population as sample size gets larger.

$\endgroup$

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