0
votes

I've looked through similar problems and I am unable to resolve mine based on what has been answered with them. I have a histogram of Body Mass Index Data. I have found the mean and sd of the data, and I am trying to overlay a normal pdf with the same mean and sd of the data to compare it with the histogram.

Here is what I have so far.

I used hist(BMI) to graph the histogram. I found the mean(BMI) to be 26.65 and the sd(BMI) to be 3.47.

I am trying to use the curve function to plot a normal curve with those same parameters over the histogram.

curve(dnorm(x, mean = 26.65, sd = 3.47), add = T, col = "red")

HistOverlay

As you can see, the red curve is barely visible at the very bottom of the histogram. Why is this error occurring?

Thank you.

1
If you want to plot densities, you have to convert histogram to density - divide bins by bin width and be sure integral is equal to 1 - Severin Pappadeux
@SeverinPappadeux Yeah. Or you know just use probability=TRUE in the hist statement. - Dason

1 Answers

1
votes

The normal distribution is probability density function. Hence the integral of the function is 1. Simply speaking, it is the probability that a single individual has this BMI. To generate the result you want to have you need to multiply the curve with the size of your population.

Something along the line: curve(100*dnorm(x, mean = 26.65, sd = 3.47), add = T, col = "red")