The SURVEYMEANS Procedure

Domain Statistics

When you use a DOMAIN statement to request a domain analysis, the procedure computes the requested statistics for each domain.

For a domain D, let $I_ D$ be the corresponding indicator variable:

\[  I_{D}(h,i,j) = \left\{  \begin{array}{ll} 1 &  \mbox{if observation $(h,i,j)$ belongs to \Mathtext{D}} \\ 0 &  \mbox{otherwise} \end{array} \right.  \]

Let

\[ z_{hij}\hspace{.1in}=\hspace{.1in} y_{hij}I_ D(h,i,j) \hspace{.1in} = \left\{  \begin{array}{ll} y_{hij} &  \mbox{if observation $(h,i,j)$ belongs to \Mathtext{D}} \\ 0 &  \mbox{otherwise} \end{array} \right.  \]

Let

\[ v_{hij}= w_{hij}I_ D(h,i,j) = \left\{  \begin{array}{ll} w_{hij} &  \mbox{if observation $(h,i,j)$ belongs to \Mathtext{D}} \\ 0 &  \mbox{otherwise} \end{array} \right.  \]

The requested statistics for variable y in domain D are computed by using the new weights v.

Note that $z_{hij}$ is set to missing if $y_{hij}$ represents a level of a categorical variable and $y_{hij}$ is missing.

Domain Mean

The estimated mean of y in the domain D is

\[  \widehat{\bar{Y}_ D} = \left( \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~  v_{hij} ~  y_{hij} \right) / ~  v_{\cdot \cdot \cdot }  \]

where

\[  v_{\cdot \cdot \cdot } = \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} v_{hij}  \]

The variance of $\widehat{\bar{Y}_ D}$ is estimated by

\[ \widehat{V}(\widehat{\bar{Y}_ D}) = \sum _{h=1}^ H \widehat{V_ h}(\widehat{\bar{Y}_ D})  \]

where, if $n_ h>1$, then

\begin{eqnarray*}  \widehat{V_ h}(\widehat{\bar{Y}_ D}) & =&  \frac{{n}_ h(1-f_ h)}{{n}_ h-1} ~  \sum _{i=1}^{n_ h} {(r_{hi\cdot }-\bar{r}_{h\cdot \cdot })^2} \\ r_{hi\cdot }& =&  \left( \sum _{j=1}^{m_{hi}}v_{hij}~ (y_{hij}- \widehat{\bar{Y}_ D}) \right) / ~  v_{\cdot \cdot \cdot } \\ \bar{r}_{h\cdot \cdot } & =&  \left( \sum _{i=1}^{n_ h}r_{hi\cdot } \right) / ~  {n}_ h \end{eqnarray*}

and if $n_ h=1$, then

\[  \widehat{V_ h}(\widehat{\bar{Y}_ D}) = \left\{  \begin{array}{ll} \mbox{missing} &  \mbox{ if } n_{h}=1 \mbox{ for } h’=1, 2, \ldots , H \\ 0 &  \mbox{ if } n_{h}>1 \mbox{ for some } 1 \le h’ \le H \end{array} \right.  \]
Domain Total

The estimated total in domain D is

\[  \widehat{Y}_ D = \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~  v_{hij} ~  y_{hij}  \]

and its estimated variance is

\[  \widehat{V}(\widehat{Y}_ D) = \sum _{h=1}^ H \widehat{V_ h}(\widehat{Y}_ D)  \]

where, if $n_ h>1$, then

\begin{eqnarray*}  \widehat{V_ h}(\widehat{Y}_ D) & =&  { \frac{{n}_ h(1-f_ h)}{{n}_ h-1} \sum _{i=1}^{n_ h} {(z_{hi\cdot }-\bar{z}_{h\cdot \cdot })^2}} \\ z_{hi\cdot }& =&  \sum _{j=1}^{m_{hi}} ~  v_{hij} ~  z_{hij}\\ \bar{z}_{h\cdot \cdot } & =&  \left( \sum _{i=1}^{n_ h}z_{hi\cdot } \right) ~  / ~  {n}_ h \end{eqnarray*}

and if $n_ h=1$, then

\[  \widehat{V_ h}(\widehat{Y}_ D) = \left\{  \begin{array}{ll} \mbox{missing} &  \mbox{ if } n_{h}=1 \mbox{ for } h’=1, 2, \ldots , H \\ 0 &  \mbox{ if } n_{h}>1 \mbox{ for some } 1 \le h’ \le H \end{array} \right.  \]
Domain Ratio

The estimated ratio of Y to X in domain D is

\[  \widehat{R}_ D = \frac{ \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~  v_{hij} ~  y_{hij} }{ \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~  v_{hij} ~  x_{hij} }  \]

and its estimated variance is

\[  \widehat{V}(\widehat{R}_ D) = \sum _{h=1}^ H \widehat{V_ h}(\widehat{R}_ D)  \]

where, if $n_ h>1$, then

\begin{eqnarray*}  \widehat{V_ h}(\widehat{R}_ D) & =&  \frac{n_ h(1-f_ h)}{n_ h-1} ~  \sum _{i=1}^{n_ h} {(g_{hi\cdot }-\bar{g}_{h\cdot \cdot })^2}\\ g_{hi\cdot }& =&  \frac{\sum _{j=1}^{m_{hi}}v_{hij}~ (y_{hij}- x_{hij}\widehat{R}_ D) }{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~  v_{hij} ~  x_{hij}}\\ \bar{g}_{h\cdot \cdot } & =&  \left( \sum _{i=1}^{n_ h}g_{hi\cdot } \right) / ~  n_ h \end{eqnarray*}

and if $n_ h=1$, then

\[  \widehat{V_ h}(\widehat{R}_ D) = \left\{  \begin{array}{ll} \mbox{missing} &  \mbox{ if } n_{h}=1 \mbox{ for } h’=1, 2, \ldots , H \\ 0 &  \mbox{ if } n_{h}>1 \mbox{ for some } 1 \le h’ \le H \end{array} \right.  \]

For domain analysis with poststratification, see the section Poststratification. For quantile estimation in a domain, see the section Domain Quantile. For quantile estimation in a domain with poststratification, see the section Domain Quantile Estimation with Poststratification.