# Complex Samples t-Test of a Mean

Where $\displaystyle{ \bar x }$ is the observed mean, $\displaystyle{ e }$ is the expected value, $\displaystyle{ s_{\bar x} }$ is the estimated Standard Error of the observed mean and $\displaystyle{ n }$ is the sample size:
$\displaystyle{ t = \frac{\bar x - e}{s_{\bar x}} }$
where $\displaystyle{ p = 2 \Pr(t_{n-1} \ge |t|) }$ if $\displaystyle{ \bar x \ne e }$ and NaN otherwise.