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

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

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

where:

${\displaystyle p=2\Pr(t_{v}\geq |t|)}$,
${\displaystyle g_{k}=(g_{t}-g_{s}w_{s})/(1-w_{s})}$,
${\displaystyle se_{k}={\sqrt {\frac {g_{k}(1-g_{k})}{n_{t}-n_{s}-b}}}}$,
${\displaystyle se_{g}={\sqrt {\frac {g_{g}(1-g_{g})}{n_{s}-b}}}}$,
${\displaystyle 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), ${\displaystyle v=n_{t}-2b}$
${\displaystyle b}$ is 1 if Bessel's correction is selected for Proportions in Statistical Assumptions and 0 otherwise,
${\displaystyle d_{eff}}$ is Extra Deff, and
${\displaystyle w_{s}}$ is the proportion of the Population represents by the sub-group.