Where \(g\) is the observed proportion, \(e\) is the expected proportion, \(s_p\) is estimated Standard Error of the observed proportion and \(n\) is the sample size:
\[\begin{align} t = \frac{g - e}{s_p} \end{align},\]
where \(p = 2 \Pr(t_{n-1} \ge t)\) if \(g \ne e\) and NaN otherwise.