# Complex Samples Dependent T-Test - Comparing a Sub-Group Proportion to Total

Where $g_{t}$ is the proportion in the total sample and $g_{s}$ is the proportion in the sub-group, $n_{t}$ and $n_{s}$ are their respective effective sample sizes, and $w_{s}$ is the proportion of the total population in sub-group $s$ :

$t={\frac {g_{t}-g_{s}}{(1-w_{s}){\sqrt {d_{eff}(se_{s}^{2}+se_{k}^{2})}}}}$ ,

where:

$p=2\Pr(t_{v}\geq |t|)$ ,
$g_{k}=(g_{t}-g_{s}w_{s})/(1-w_{s})$ ,
$se_{k}={\sqrt {\frac {g_{k}(1-g_{k})}{n_{t}-n_{s}-b}}}$ ,
$se_{g}={\sqrt {\frac {g_{g}(1-g_{g})}{n_{s}-b}}}$ ,
$v={\frac {({\frac {se_{s}^{2}}{n_{s}}}+{\frac {se_{k}^{2}}{n_{k}}})^{2}}{{\frac {({\frac {se_{s}^{2}}{n_{s}}})^{2}}{n_{s}-b}}+{\frac {({\frac {se_{k}^{2}}{n_{k}}})^{2}}{n_{k}-b}}}}$ , or, if Weights and significance is set to Un-weighted sample size in tests (see Weights, Effective Sample Size and Design Effects), $v=n_{t}-2b$ $b$ is 1 if Bessel's correction is selected for Proportions in Statistical Assumptions and 0 otherwise,
$d_{eff}$ is Extra Deff, and
$w_{s}$ is the proportion of the Population represents by the sub-group.