Investment Studio > Expressions > Functions > Statistical > CONFIDENCE

float confidence(float alpha, float standard_deviation, integer size)

Returns the confidence interval for a population mean.

alpha is the significance level of the requested confidence interval. The significance level = 1 - confidence level: for instance, alpha = 0.05 is equivalent to a 0.95 (95%) confidence level.

standard_deviation is the standard deviation of the population (see stdev, stdevp).

size is the number of elements in the sample.

Computation of the confidence interval is based on the normal distribution (see functions normdist, norminv, normsdist, normsinv). In particular, the expression

=confidence(alpha, 1, 1)

returns the position la/2 such that the area in the x interval [-la/2, la/2] under a standard normal distribution equals 1 - alpha, while the area in the left tail ]-¥, la/2] equals the area in the right tail [la/2, ], i.e. alpha / 2. The number la/2 can be used in a variety of contexts involving the estimation of confidence intervals.

The generic form confidence(alpha, standard_deviation, size) is equivalent to the expression

=confidence(alpha, 1, 1) * standard_deviation / sqrt(size)

Example

We measure the average length of 50 randomly selected people (size = 50) to be 1.75 meters, with standard deviation 0.10 meters. We can be 95% confident that the average length for the entire population is 1.75 ±

=confidence(1 - 95%, 0.1, 50)

or 1.75 ± 0.028 meters. If we want to state the population's average length with 99% cofidence, the corresponding error margin is ±

=confidence(1 - 99%, 0.1, 50)

or ±0.03643 meters.

See also fisher, normdist, norminv, normsdist, normsinv, stdev, stdevp, ttest, ztest.