# 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^2_s + se^2_k)}}$,

where:

$p = 2\Pr(t_v \ge |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^2_s}{n_s} +\frac{se^2_k}{n_k} )^2}{\frac{(\frac{se^2_s}{n_s})^2}{n_s-b}+\frac{(\frac{se^2_k}{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.