Where \(g\) is the observed proportion and \(e\) is the expected proportion, \(n\) is the sample size and \(d_{eff}\) is Extra deff:
\[\begin{align} t = \frac{g - e}{\sqrt{d_{eff}g(1-g)/n}} \end{align}\]
where \(p \approx 2\Pr(t_{n-1} \ge |t|)\) if \(g \ne e\) and NaN otherwise,
Where Bessel's correction is applied:
\(t = \frac{p - e}{\sqrt{d_{eff}g(1-g)/(n-1)}}\)