i

R Programming Complete Tutorial

Normal Distribution

It is an arrangement of a data set in which most values are clustered in the middle of the range and the remainder taper symmetrically towards either extreme.Because of their flared form, a graphic representation of a normal distribution is sometimes called a bell curve. The normal distribution is defined by the following function, where μ is the population mean, and σ² is the variance.

Formula:

If a random variable X follows the normal distribution, then we write:

Example of Normal Distribution:

The normal distribution has:

  • mean = median = mode
  • symmetry about the center
  • 50% of values less than the mean and 50% greater than the mean

Height is one simple example of something that follows a normal distribution pattern. The majority of people are of average height, the numbers of people that are taller and shorter than average are fairly equal, and a very small number of people are either extremely tall or extremely short.

  • 68% of values are within 1 standard deviation of the mean
  • 95% of values are within 2 standard deviation of the mean
  • 99.7% of values are within 3 standard deviation of the mean

R Normal Distribution:

dnorm() : This function gives the height of the probability distribution at each point for a given mean and standard deviation.

Plot Result:

pnorm(): This function gives the probability that a normally distributed random number is less than that of a given number.

Plot Result:

qnorm(): This function takes the value of probability and gives a number whose cumulative value matches the probability.

Plot Result:

rnorm(): This function is used to produce random numbers that have a normal distribution. This takes as input the sample size and generates that many random numbers.

Result