Function Repository Resource:

InverseSigmaConfidenceLevel

Source Notebook

Calculate the number of standard deviations of a normal distribution that correspond to a confidence level

Contributed by: Julien Kluge

ResourceFunction["InverseSigmaConfidenceLevel"][cl]

calculates the number of standard deviations around the mean containing the given fraction of a normal distribution.

Details and Options

ResourceFunction["InverseSigmaConfidenceLevel"] automatically threads over lists.
ResourceFunction["InverseSigmaConfidenceLevel"] evaluates to exact outputs for exact inputs and certain values.
The associated standard deviation for a one-sided p-value can be calculated by using σ=ResourceFunction["InverseSigmaConfidenceLevel"][1-2p].

Examples

Basic Examples (2) 

A confidence level of 0.95 spans approximately two standard deviations:

In[1]:=
ResourceFunction["InverseSigmaConfidenceLevel"][0.95]
Out[1]=

A one-sided p-value of 0.05 is equivalent to around 1.64 standard deviations:

In[2]:=
ResourceFunction["InverseSigmaConfidenceLevel"][1 - 2*0.05]
Out[2]=

Scope (4) 

Exact inputs yield exact results:

In[3]:=
ResourceFunction["InverseSigmaConfidenceLevel"][1/2]
Out[3]=

InverseSigmaConfidenceLevel automatically threads over lists:

In[4]:=
ResourceFunction["InverseSigmaConfidenceLevel"][{1/2, 0, 0.5, 1}]
Out[4]=

InverseSigmaConfidenceLevel can be defined as the inverse CDF of the NormalDistribution with mean 0 and standard deviation 1:

In[5]:=
InverseCDF[NormalDistribution[0, 1], 1/2 (1 + p)] == ResourceFunction["InverseSigmaConfidenceLevel"][p] /. p -> 95/100 //
  N
Out[5]=

InverseSigmaConfidenceLevel is the inverse to the resource function SigmaConfidenceLevel:

In[6]:=
ResourceFunction["InverseSigmaConfidenceLevel"][
 ResourceFunction["SigmaConfidenceLevel"][5]]
Out[6]=
In[7]:=
ResourceFunction["SigmaConfidenceLevel"][
 ResourceFunction["InverseSigmaConfidenceLevel"][1/2]]
Out[7]=

Properties and Relations (2) 

Values of unity get replaced with Infinity:

In[8]:=
ResourceFunction["InverseSigmaConfidenceLevel"][{-1, 1}]
Out[8]=

Arguments containing a top-level Erf get replaced with an expression containing no Erf or InverseErf heads:

In[9]:=
ResourceFunction["InverseSigmaConfidenceLevel"][Erf[1]]
Out[9]=

Possible Issues (1) 

Values with a magnitude above one are left unevaluated:

In[10]:=
ResourceFunction["InverseSigmaConfidenceLevel"][{3.0, 2.0, -2.0}]
Out[10]=

Neat Examples (1) 

The Mensa organization only accepts members with an IQ test coming out in the top 2%. Calculate the lower IQ limit to pass this bar:

In[11]:=
\[Mu] + ResourceFunction["InverseSigmaConfidenceLevel"][
    1 - 2*p]*\[Sigma] /. {\[Mu] -> 100, \[Sigma] -> 15, p -> 0.02}
Out[11]=

Publisher

Julien Kluge

Version History

  • 1.0.0 – 12 May 2020

Related Resources

Author Notes

Julien Kluge

Quantum Optical Metrology; Joint Lab Integrated Quantum Sensors

Department of Physics

Humboldt-Universität zu Berlin

julien@physik.hu-berlin.de

License Information