Confidence Interval

Author

Eric W. Weisstein
October 28, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Statistics/ConfidenceInterval.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/ConfidenceInterval.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Statistics`ConfidenceIntervals`

Normal Distribution

FullSimplify[Integrate[Exp[-(x-μ)^2/(2σ^2)],{x,μ-n σ,μ+n σ}]/(σ Sqrt[2π])]

FullSimplify[Integrate[Exp[-(x-μ)^2/(2σ^2)],{x,μ,μ+n σ}]2/(σ Sqrt[2π])]

Probabilities corresponding to multiples of σ

<<Graphics`Colors`

Plot[Erf[n/Sqrt[2]],{n,0,4},PlotStyle->Red,
AxesLabel->TraditionalForm/@{n,P}]

Table[{n σ,N[Erf[n/Sqrt[2]],17]},{n,5}]//TableForm//TraditionalForm

Confidence Intervals

Plot[Sqrt[2]InverseErf[n],{n,0,1},PlotStyle->Red,
AxesLabel->TraditionalForm/@{P,n}]

{N@#,N[Sqrt[2]InverseErf[#],17]σ}&/@{80/100,90/100,95/100,99/100,995/1000,999/1000}//TableForm//TraditionalForm

{N[#],N[NormalCI[0,1,ConfidenceLevel->#],17]σ}&/@{80/100,90/100,95/100,99/100,995/1000,999/1000}//ColumnForm//TraditionalForm