About the distribution calculator

The Distribution Calculator makes it easy to:

  1. Calculate areas under a specific distribution curve.
  2. Simulate random samples from a distribution.
  3. Calculate critical values for a specific distribution.
  4. Learn R codes used to generate results.

Access the calculator by clicking on Distribution Calculator on the left sidebar. This will display the output in four boxes.

Box 1: Areas under a distribution

To calculate the area under a distribution curve, enter the following information in the sidebar:

  1. Specify a distribution.
  2. Specify the parameters of the distribution (e.g. mean and standard deviation for Normal distribution) by using the drop-down list. The required parameters will change, depending on your choice of distribution.
  3. Indicate whether you want to find the area above a certain value ( Upper Tail ), below a certain value ( Lower Tail ), between two values ( Middle ), or outside two values ( Both Tails ) by using the Find area drop down menu.
  4. Enter the value of a. For instance, if you want to find the area above 10, enter 10. If you have chosen Middle or Both Tails in step 3, two drop-down lists will appear, and you need to enter two values, a and b

The area will be shaded and the size of the area will be shown under the curve in Box 1.

Box 2: Simulation of random samples from a distribution

To simulate and display the distribution of random samples from a specific distribution:

  1. Specify the distribution and the parameters in the sidebar.
  2. Select the number of observations by using the slider in Box 2.
  3. Insert a density curve over the histogram by clicking on Draw density curve in Box 2.

Box 3: Calculate critical values

To calculate the critical values (i.e. the points which cut off a given probability) for a specific distribution:

  1. Specify the distribution and the parameters in Box 3.
  2. Specify a probability
  3. Select whether the probability relates to the upper tail, the lower tail or both tails.

The critical value(s) will be shown at the bottom of Box 3.

Box 4: R codes

R codes used to generate results:

  1. List of basic R functions used in this application is given here.
  2. To learn more about specific R function and its arguments type the question mark followed by the function name (e.g. ?hist) in the RStudio console.

Box 1: Areas under a distribution

Box 2: Simulation of random samples from a distribution

Box 4: R codes

R codes used to generate results

Standard Normal distribution density:

dnorm(x, mean = 0, sd = 1)

x are quantiles, mean and sd are mean value and standard deviation respectively.

Simulate n random samples from the standard Normal distribution:

rnorm(n, mean = 0, sd = 1)

Calculate critical values for the standard Normal distribution:

qnorm(p, mean = 0, sd = 1)

p are probabilities. Replace norm with binom, t, chisq or F to get results for binomial, t, chi-squared and F distributions respectively.

Generate histogram:

hist(x)

x is a numeric vector.