Solved – the difference between dbinom and dnorm in R

distributionsnormal distribution

I'm a huge newbie when it comes to statistics and R.

I'm trying to make sense of all of these functions as someone who hasn't taken statistics before.

In R, from what I've understood, with dbinom, you enter the number of trials, the probability of success, and a number of successes n, all as arguments, and it returns the probability that the trial will succeed n times in a certain number of traiils. Is this correct? dbinom is the probability density function, right?

As you can probably tell, there are a lot of things I'm confused about.

First, can a probability density function only return a non-zero probability if the data is discrete?

pbinom is the cumulative version of the probability density function, correct? If the data is continuous, I would use the cumulative function, right?

And now for the big question, what is the difference between dbinom/pbinom and dnorm/pnorm?

From my understanding, pbinom gives you that probability that I first mentioned. You enter an number of successes, number of trials, and probability of success, and it returns a probability. However, with dnorm, I don't understand what it is I enter. I know that I enter an x (which presumably also represents a number of successes), as well as a mean and a standard deviation. I also know that it does this for a normal distribution. What I don't understand is, why doesn't it ask for a probability, or a number of trials. Why does the x axis have negative values this time? What does it even return? Shouldn't it return 0 since presumably it's not discrete? I know that it actually returns the calculation from the equation (the one with the standard deviation and mean), but I don't know what the equation really even represents.

Can someone set me on the right track, because I feel lost in all these terms, equations, and functions.

Best Answer

And now for the big question, what is the difference between dbinom/pbinom and dnorm/pnorm?

dbinom is a probability mass function of binomial distribution, while pbinom is a cumulative distribution function of this distribution. The first one tells you what is $\Pr(X=x)$ (probability of observing value equal to $x$), while the second one, what is $\Pr(X \le x)$ (probability of observing value smaller or equal then $x$). Notice that cumulative distribution function has nothing to do with data being continuous, or discrete, there are cumulative distribution functions for both kind of variables (and for mixed types).

As about dnorm, it is a probability density function, to learn more about it see the Can a probability distribution value exceeding 1 be OK? thread.

Related Question