How to Make a Bell Curve in R?
To make a bell curve in R we will be using the help of normal distribution which will lead to a bell curve that will be symmetrical about the mean. Half of the data will fall to the left of the mean and half will fall to the right.
In probability theory, a normal distribution is a type of continuous probability distribution for a real-valued random variable.
is standard deviation.
For the normal distribution, we use dnorm() function to get the value of the probability density function for the normal distribution given parameters for x, μ, and σ.
Syntax: dnorm(x, mean, sd) (sd=Standard Deviation)
- X is a vector of numbers.
- Mean is the mean value of the sample data. Its default value is zero.
- Sd is the standard deviation. Its default value is 1.
Returns:-The probability distribution at each point for a given mean and standard deviation.
- Create a sequence of numbers
- Get probability distribution at each point for a given mean and standard deviation
- Plot data with appropriate attributes>