Skip to contents

normprob finds a p-value and plots it onto a normal distribution with mean and standard deviation as specified. The function can find the probability above, below, between, or outside of the observed value, as specified by directions.

Usage

normprob(
  xval,
  mean = 0,
  sd = 1,
  direction,
  label = NULL,
  xval2 = NULL,
  digits = 4
)

Arguments

xval

observed value.

mean

mean of normal distribution.

sd

standard deviation of normal distribution.

direction

direction for probability calculation, "above" or "below"; if "outside" or "between" are used, a second larger observation, xval2 must be specified

label

horizontal axis label.

xval2

second observation value.

digits

number of digits to display.

Value

a p-value and a plot of the normal distribution with shaded area representing probability of the observed value or more extreme occurring.