Where \(\bar x\) is the observed mean, \(e\) is the expected value, \(s_{\bar x}\) is the estimated Standard Error of the observed mean and \(n\) is the sample size:
\[\begin{align} z = \frac{\bar x - e}{s_{\bar x}} \end{align},\]
where \(p = 2(1-\Phi(|z|))\) if \(\bar x \ne e\) and NaN otherwise.