Compute the P value of a cumulative distribution function (cdf).
Usage
p_value(cdf, x, paramet = numeric(0), side = 0)
Value
The P value.
Arguments
cdf
The cumulative distribution function. For normal distribution, cdf = pnorm.
x
A given value to compute the P value.
paramet
The parameter of the corresponding distribution. For normal distribution, paramet = c(mu, sigma).
side
A parameter indicating whether to compute one sided or two sided P value. When inputting side = -1 (or a number < 0), the function computes a left side P value; when inputting side = 1 (or a number > 0), the function computes a right side P value; when inputting side = 0 (default), the function computes a two sided P value.