In human language the rnorm(n=1000, m=24.2, sd=2.2)
returns the random numbers which follows normal distribution. Another explanation could be that it returns random numbers from which the histogram can be created. If you draw normal (bell shaped) curve it will perfectly fits to this histogram. Can you please explain dnorm
in such human language (or even with math and/or graphic but to be understandable by newbie)?
Solved – rnorm vs dnorm in R
distributionsnormal distributionr
Best Answer
You know the probability density function for a standard normal distribution is
$\frac{1}{\sqrt{2\pi}}e^\frac{-x^2}{2} $.
The dnorm() function is just used to calculate the value of this function.
You can test using the following R code
They are equal. For non-standard normal it's same.