The SURVEYMEANS Procedure

Statistical Computations

The SURVEYMEANS procedure uses the Taylor series (linearization) method or replication (resampling) methods to estimate sampling errors of estimators based on complex sample designs. For more information, see Fuller (2009); Wolter (2007); Lohr (2010); Kalton (1983); Hidiroglou, Fuller, and Hickman (1980); Fuller et al. (1989); Lee, Forthofer, and Lorimor (1989); Cochran (1977); Kish (1965); Hansen, Hurwitz, and Madow (1953); Rust (1985); Dippo, Fay, and Morganstein (1984); Rao and Shao (1999); Rao, Wu, and Yue (1992); Rao and Shao (1996). You can use the VARMETHOD= option to specify a variance estimation method to use. By default, the Taylor series method is used.

The Taylor series method obtains a linear approximation for the estimator and then uses the variance estimate for this approximation to estimate the variance of the estimate itself (Woodruff 1971; Fuller 1975). When there are clusters, or PSUs, in the sample design, the procedure estimates variance from the variation among PSUs. When the design is stratified, the procedure pools stratum variance estimates to compute the overall variance estimate. For t tests of the estimates, the degrees of freedom equal the number of clusters minus the number of strata in the sample design.

For a multistage sample design, the Taylor series estimation depends only on the first stage of the sample design. Therefore, the required input includes only first-stage cluster (PSU) and first-stage stratum identification. You do not need to input design information about any additional stages of sampling. This variance estimation method assumes that the first-stage sampling fraction is small, or that the first-stage sample is drawn with replacement, as it often is in practice.

Quite often in complex surveys, respondents have unequal weights, which reflect unequal selection probabilities and adjustments for nonresponse. In such surveys, the appropriate sampling weights must be used to obtain valid estimates for the study population.

However, replication methods have recently gained popularity for estimating variances in complex survey data analysis. One reason for this popularity is the relative simplicity of replication-based estimates, especially for nonlinear estimators; another is that modern computational capacity has made replication methods feasible for practical survey analysis.

Replication methods draw multiple replicates (also called subsamples) from a full sample according to a specific resampling scheme. The most commonly used resampling schemes are the balanced repeated replication (BRR) method and the jackknife method. For each replicate, the original weights are modified for the PSUs in the replicates to create replicate weights. The population parameters of interest are estimated by using the replicate weights for each replicate. Then the variances of parameters of interest are estimated by the variability among the estimates derived from these replicates. You can use a REPWEIGHTS statement to provide your own replicate weights for variance estimation. For more information about using replication methods to analyze sample survey data, see the section Replication Methods for Variance Estimation.

Definitions and Notation

For a stratified clustered sample design, together with the sampling weights, the sample can be represented by an $n \times (P+1)$ matrix

\begin{eqnarray*} (\mb{w,Y}) & =& \left( w_{hij}, \mb{y}_{hij} \right) \\ & =& \left( w_{hij}, y_{hij}^{(1)}, y_{hij}^{(2)}, \ldots , y_{hij}^{(P)}\right) \end{eqnarray*}

where

  • $h=1, 2, \ldots , H$   is the stratum index

  • $i=1, 2, \ldots , n_ h$   is the cluster index within stratum h

  • $j=1, 2, \ldots , m_{hi}$   is the unit index within cluster i of stratum h

  • $p=1, 2, \ldots , P$   is the analysis variable number, with a total of P variables

  • $n=\sum _{h=1}^ H \sum _{i=1}^{n_ h} {m_{hi}}$   is the total number of observations in the sample

  • $w_{hij}$   denotes the sampling weight for unit j in cluster i of stratum h

  • $\mb{y}_{hij}=\left( y_{hij}^{(1}), y_{hij}^{(2)}, \ldots , y_{hij}^{(P)}\right)$   are the observed values of the analysis variables for unit j in cluster i of stratum h, including both the values of numerical variables and the values of indicator variables for levels of categorical variables.

For a categorical variable C, let l denote the number of levels of C, and denote the level values as $c_1, c_2, \ldots , c_ l$. Let $y^{(q)}$ $(q\in \{ 1, 2, \ldots , P\} )$ be an indicator variable for the category $C=c_ k$ $(k=1, 2, \ldots , l)$ with the observed value in unit j in cluster i of stratum h:

\[ y_{hij}^{(q)} = I_{\{ C=c_ k\} }(h,i,j) = \left\{ \begin{array}{ll} 1 & \mbox{if } C_{hij}=c_ k \\ 0 & \mbox{otherwise} \end{array} \right. \]

Note that the indicator variable $ y_{hij}^{(q)}$ is set to missing when $C_{hij}$ is missing. Therefore, the total number of analysis variables, P, is the total number of numerical variables plus the total number of levels of all categorical variables.

The sampling rate $f_ h$ for stratum h, which is used in Taylor series variance estimation, is the fraction of first-stage units (PSUs) selected for the sample. You can use the TOTAL= or RATE= option to input population totals or sampling rates. See the section Specification of Population Totals and Sampling Rates for details. If you input stratum totals, PROC SURVEYMEANS computes $f_ h$ as the ratio of the stratum sample size to the stratum total. If you input stratum sampling rates, PROC SURVEYMEANS uses these values directly for $f_ h$. If you do not specify the TOTAL= or RATE= option, then the procedure assumes that the stratum sampling rates $f_ h$ are negligible, and a finite population correction is not used when computing variances. Replication methods specified by the VARMETHOD=BRR or the VARMETHOD=JACKKNIFE option do not use this finite population correction $f_ h$.

Mean

When you specify the keyword MEAN, the procedure computes the estimate of the mean (mean per element) from the survey data. Also, the procedure computes the mean by default if you do not specify any statistic-keywords in the PROC SURVEYMEANS statement.

PROC SURVEYMEANS computes the estimate of the mean as

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

where

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

is the sum of the weights over all observations in the sample.

Variance and Standard Error of the Mean

When you specify the keyword STDERR, the procedure computes the standard error of the mean. Also, the procedure computes the standard error by default if you specify the keyword MEAN, or if you do not specify any statistic-keywords in the PROC SURVEYMEANS statement. The keyword VAR requests the variance of the mean.

Taylor Series Method

When you use VARMETHOD=TAYLOR , or by default if you do not specify the VARMETHOD= option, PROC SURVEYMEANS uses the Taylor series method to estimate the variance of the mean $\widehat{\bar{Y}}$. The procedure computes the estimated variance as

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

where, if $n_ h>1$, then

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

and if $n_ h=1$, then

\[ \widehat{V_ h}(\widehat{\bar{Y}}) = \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. \]
Replication Methods

When you specify VARMETHOD=BRR or VARMETHOD=JACKKNIFE , the procedure computes the variance $\widehat{V}(\widehat{{\bar{Y}}})$ with replication methods by using the variability among replicate estimates to estimate the overall variance. See the section Replication Methods for Variance Estimation for more details.

Standard Error

The standard error of the mean is the square root of the estimated variance.

\[ \mbox{StdErr}(\widehat{{\bar{Y}}})= \sqrt {\widehat{V}(\widehat{\bar{Y}})} \]

t Test for the Mean

If you specify the keyword T, PROC SURVEYMEANS computes the t-value for testing that the population mean equals zero, $H_0: \bar{Y} = 0$. The test statistic equals

\[ t(\widehat{{\bar{Y}}}) = {\widehat{{\bar{Y}}}} ~ / ~ {\mbox{StdErr}(\widehat{{\bar{Y}}})} \]

The two-sided p-value for this test is

\[ \mbox{Prob}(~ |T|>|t(\widehat{{\bar{Y}}})|~ ) \]

where T is a random variable with the t distribution with df degrees of freedom.

Degrees of Freedom

PROC SURVEYMEANS computes degrees of freedom df to obtain the $100(1 - \alpha )$% confidence limits for means, proportions, totals, ratios, and other statistics. The degrees of freedom computation depends on the variance estimation method that you request. Missing values can affect the degrees of freedom computation. See the section Missing Values for details.

Taylor Series Variance Estimation

For the Taylor series method, PROC SURVEYMEANS calculates the degrees of freedom for the t test as the number of clusters minus the number of strata. If there are no clusters, then the degrees of freedom equal the number of observations minus the number of strata. If the design is not stratified, then the degrees of freedom equal the number of PSUs minus one.

If all observations in a stratum are excluded from the analysis due to missing values, then that stratum is called an empty stratum. Empty strata are not counted in the total number of strata for the table. Similarly, empty clusters and missing observations are not included in the total counts of cluster and observations that are used to compute the degrees of freedom for the analysis.

If you specify the MISSING option, missing values are treated as valid nonmissing levels for a categorical variable and are included in computing degrees of freedom. If you specify the NOMCAR option for Taylor series variance estimation, observations with missing values for an analysis variable are included in computing degrees of freedom.

Replicate-Based Variance Estimation

When there is a REPWEIGHTS statement, the degrees of freedom equal the number of REPWEIGHTS variables, unless you specify an alternative in the DF= option in a REPWEIGHTS statement.

For BRR or jackknife variance estimation without a REPWEIGHT statement, by default PROC SURVEYMEANS computes the degrees of freedom by using all valid observations in the input data set. A valid observation is an observation that has a positive value of the WEIGHT variable and nonmissing values of the STRATA and CLUSTER variables unless you specify the MISSING option. See the section Data and Sample Design Summary for details about valid observations.

For BRR variance estimation (including Fay’s method ) without a REPWEIGHTS statement, PROC SURVEYMEANS calculates the degrees of freedom as the number of strata. PROC SURVEYMEANS bases the number of strata on all valid observations in the data set, unless you specify the DFADJ method-option for VARMETHOD=BRR . When you specify the DFADJ option, the procedure computes the degrees of freedom as the number of nonmissing strata for an analysis variable. This excludes any empty strata that occur when observations with missing values of that analysis variable are removed.

For jackknife variance estimation without a REPWEIGHTS statement, PROC SURVEYMEANS calculates the degrees of freedom as the number of clusters (or number of observations if there are no clusters) minus the number of strata (or one if there are no strata). For jackknife variance estimation, PROC SURVEYMEANS bases the number of strata and clusters on all valid observations in the data set, unless you specify the DFADJ method-option for VARMETHOD=JACKKNIFE . When you specify the DFADJ option, the procedure computes the degrees of freedom from the number of nonmissing strata and clusters for an analysis variable. This excludes any empty strata or clusters that occur when observations with missing values of an analysis variable are removed.

The procedure displays the degrees of freedom for the t test if you specify the keyword DF in the PROC SURVEYMEANS statement.

Confidence Limits for the Mean

If you specify the keyword CLM, the procedure computes two-sided confidence limits for the mean. Also, the procedure includes the confidence limits by default if you do not specify any statistic-keywords in the PROC SURVEYMEANS statement.

The confidence coefficient is determined by the value of the ALPHA= option, which by default equals 0.05 and produces 95% confidence limits. The confidence limits are computed as

\[ \widehat{\bar{Y}} \pm \mbox{StdErr}(\widehat{{\bar{Y}}})~ t_{\mi{df},\, \, \alpha /2} \]

where $\widehat{\bar{Y}}$ is the estimate of the mean, $\mbox{StdErr}(\widehat{{\bar{Y}}})$ is the standard error of the mean, and $t_{\mi{df},\, \, \alpha /2}$ is the $100(1-\alpha /2)$th percentile of the t distribution with df calculated as in the section t Test for the Mean.

If you specify the keyword UCLM, the procedure computes the one-sided upper $100(1-\alpha )$% confidence limit for the mean:

\[ \widehat{\bar{Y}} + \mbox{StdErr}(\widehat{{\bar{Y}}})~ t_{\mi{df},\, \, \alpha } \]

If you specify the keyword LCLM, the procedure computes the one-sided lower $100(1-\alpha )$% confidence limit for the mean:

\[ \widehat{\bar{Y}} - \mbox{StdErr}(\widehat{{\bar{Y}}})~ t_{\mi{df},\, \, \alpha } \]

Coefficient of Variation

If you specify the keyword CV, PROC SURVEYMEANS computes the coefficient of variation, which is the ratio of the standard error of the mean to the estimated mean:

\[ \mr{cv}(\bar{Y}) = \mbox{StdErr}(\widehat{{\bar{Y}}}) ~ /~ \widehat{{\bar{Y}}} \]

If you specify the keyword CVSUM, PROC SURVEYMEANS computes the coefficient of variation for the estimated total, which is the ratio of the standard deviation of the sum to the estimated total:

\[ \mr{cv}(Y) = \mbox{Std}(\widehat{Y}) ~ /~ \widehat{Y} \]

Proportions

If you specify the keyword MEAN for a categorical variable, PROC SURVEYMEANS estimates the proportion, or relative frequency, for each level of the categorical variable. If you do not specify any statistic-keywords in the PROC SURVEYMEANS statement, the procedure estimates the proportions for levels of the categorical variables, together with their standard errors and confidence limits.

The procedure estimates the proportion in level $c_ k$ for variable C as

\[ \hat p=\frac{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ w_{hij} ~ y_{hij}^{(q)}}{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ w_{hij}} \]

where $y_{hij}^{(q)}$ is the value of the indicator function for level $C=c_ k$, defined in the section Definitions and Notation, and $y_{hij}^{(q)}$ equals 1 if the observed value of variable C equals $c_ k$, and $y_{hij}^{(q)}$ equals 0 otherwise. Since the proportion estimator is actually an estimator of the mean for an indicator variable, the procedure computes its variance and standard error according to the method outlined in the section Variance and Standard Error of the Mean. Similarly, the procedure computes confidence limits for proportions as in the section Confidence Limits for the Mean.

Total

If you specify the keyword SUM, the procedure computes the estimate of the population total from the survey data. The estimate of the total is the weighted sum over the sample:

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

For a categorical variable level, $ \widehat{Y} $ estimates its total frequency in the population.

Variance and Standard Deviation of the Total

When you specify the keyword STD or the keyword SUM, the procedure estimates the standard deviation of the total. The keyword VARSUM requests the variance of the total.

Taylor Series Method

When you use VARMETHOD=TAYLOR , or by default, PROC SURVEYMEANS uses the Taylor series method to estimate the variance of the total as

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

where, if $n_ h>1$, then

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

and if $n_ h=1$, then

\[ \widehat{V_ h}(\widehat{Y}) = \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. \]
Replication Methods

When you specify VARMETHOD=BRR or VARMETHOD=JACKKNIFE option, the procedure computes the variance $\widehat{V}(\widehat{Y})$ with replication methods by measuring the variability among the estimates derived from these replicates. See the section Replication Methods for Variance Estimation for more details.

Standard Deviation

The standard deviation of the total equals

\[ \mbox{Std}(\widehat{Y})= \sqrt {\widehat{V}(\widehat{Y})} \]

Confidence Limits for the Total

If you specify the keyword CLSUM, the procedure computes confidence limits for the total. The confidence coefficient is determined by the value of the ALPHA= option, which by default equals 0.05 and produces 95% confidence limits. The confidence limits are computed as

\[ \widehat{Y} \pm \mbox{Std}(\widehat{Y})~ t_{\mi{df},\, \, \alpha /2} \]

where $\widehat{Y}$ is the estimate of the total, $\mbox{Std}(\widehat{Y})$ is the estimated standard deviation, and $t_{\mi{df},\, \, \alpha /2}$ is the $100(1-\alpha /2)$th percentile of the t distribution with df calculated as described in the section t Test for the Mean.

If you specify the keyword UCLSUM, the procedure computes the one-sided upper $100(1-\alpha )$% confidence limit for the sum:

\[ \widehat{Y} + \mbox{Std}(\widehat{Y})~ t_{\mi{df},\, \, \alpha } \]

If you specify the keyword LCLSUM, the procedure computes the one-sided lower $100(1-\alpha )$% confidence limit for the sum:

\[ \widehat{Y} - \mbox{Std}(\widehat{Y})~ t_{\mi{df},\, \, \alpha } \]

Ratio

When you use a RATIO statement, the procedure produces statistics requested by the statistic-keywords in the PROC SURVEYMEANS statement.

Suppose that you want to calculate the ratio of variable Y to variable X. Let $x_{hij}$ be the value of variable X for the jth member in cluster i in the hth stratum.

The ratio of Y to X is

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

PROC SURVEYMEANS uses the Taylor series method to estimate the variance of the ratio $\widehat{R}$ as

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

where, if $n_ h>1$, then

\begin{eqnarray*} \widehat{V_ h}(\widehat{R}) & =& \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}}w_{hij}~ (y_{hij}- x_{hij}\widehat{R}) }{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ w_{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}) = \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. \]

The standard error of the ratio is the square root of the estimated variance:

\[ \mbox{StdErr}(\widehat{R})= \sqrt {\widehat{V}(\widehat{R})} \]

When the denominator for a ratio is zero, then the value of the ratio is displayed as '–Infty', 'Infty', or a missing value, depending on whether the numerator is negative, positive, or zero, respectively; and the corresponding internal value is the special missing value '.M', the special missing value '.I', or the usual missing value, respectively.

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)\mbox{ belongs to } 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)\mbox{ belongs to } 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) \mbox{belongs to} 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.

Quantiles

Let Y be the variable of interest in a complex survey. Denote $F(t)=\Pr (Y\le t)$ as the cumulative distribution function of Y. For $0<p<1$, the pth quantile of the population cumulative distribution function is

\[ Q(p)=\inf \{ y: F(y)\ge p\} \]
Estimate of Quantile

Let $\{ y_{hij}, w_{hij}\} $ be the observed values for variable Y that are associated with sampling weights, where $(h,i,j)$ are the stratum index, cluster index, and member index, respectively, as shown in the section Definitions and Notation. Let $ y_{(1)} < y_{(2)} < \cdots < y_{(n)}$ denote the sample order statistics for variable Y.

An estimate of quantile $Q(p)$ is

\[ \hat Q(p)= \left\{ \begin{array}{ll} y_{(1)} & \mbox{ if } p<\hat F(y_{(1)}) \\ y_{(k)}+\displaystyle {\frac{p-\hat F(y_{(k)})}{\hat F(y_{(k+1)})-\hat F(y_{(k)})}} (y_{(k+1)}-y_{(k)}) & \mbox{ if } \hat F(y_{(k)}) \le p < \hat F(y_{(k+1)}) \\ y_{(n)} & \mbox{ if } p=1 \end{array} \right. \]

where $\hat F(t)$ is the estimated cumulative distribution for Y,

\[ \hat F(t)=\frac{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}}w_{hij}I(y_{hij}\le t)}{\sum _{h=1}^ H\sum _{i=1}^{n_ h}\sum _{j=1}^{m_{hi}}w_{hij}} \]

and $I(\cdot )$ is the indicator function.

Standard Error

How PROC SURVEYMEANS estimates the standard error of a quantile depends on which variance method you specify in the VARMETHOD= option.

Taylor Series Method

When you specify VARMETHOD=TAYLOR , or by default if you do not specify the VARMETHOD= option, PROC SURVEYMEANS uses Woodruff’s method (Dorfman and Valliant 1993; Särndal, Swensson, and Wretman 1992; Francisco and Fuller 1991) to estimate the variances of quantiles. This method first constructs a confidence interval on a quantile $\hat Q(p)$. Then it uses the width of the confidence interval to estimate the standard error of $\hat Q(p)$. To construct the confidence interval, PROC SURVEYMEANS first estimates the variance of the estimated distribution function $\hat F(\hat Q(p))$ by

\[ \hat V(\hat F(\hat Q(p))) =\sum _{h=1}^ H \frac{n_ h(1-f_ h)}{n_ h-1} ~ \sum _{i=1}^{n_ h} {(e_{hi\cdot }-\bar{e}_{h\cdot \cdot })^2} \]

where

\begin{eqnarray*} e_{hi\cdot }& =& \left( \sum _{j=1}^{m_{hi}}w_{hij}~ (I(y_{hij} \le \hat Q(p)) - \hat F(\hat Q(p))) \right) / ~ w_{\cdot \cdot \cdot } \\ \bar{e}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}e_{hi\cdot } \right) / ~ n_ h \\ w_{\cdot \cdot \cdot } & =& \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} w_{hij} \end{eqnarray*}

Then $100(1-\alpha )$% confidence limits for $\hat F(\hat Q(p))$ can be constructed by

\[ \left(\hat p_ L, \, \, \, \, \, \, \hat p_ U\right)=\left(\hat F(\hat Q(p))-t_{\mi{df},\, \, \alpha /2}\sqrt {\hat V(\hat F(\hat Q(p)))}, \, \, \, \, \, \, \, \, \hat F(\hat Q(p))+t_{\mi{df},\, \, \alpha /2}\sqrt {\hat V(\hat F(\hat Q(p)))}\right) \]

where $t_{\mi{df},\, \, \alpha /2}$ is the $100(1-\alpha /2)$th percentile of the t distribution with df degrees of freedom, described in the section Degrees of Freedom.

When $(\hat p_ L, \hat p_ U)$ is out of the range of [0,1], the procedure does not compute the standard error of $\hat Q(p)$.

The $\hat p_ L$th quantile is defined as

\[ \hat Q(\hat p_ L)= \left\{ \begin{array}{ll} y_{(1)} & \mbox{ if } \hat p_ L<\hat F(y_{(1)}) \\ y_{(k_ L)}+\displaystyle {\frac{\hat p_ L-\hat F(y_{(k_ L)})}{\hat F(y_{(k_ L+1)})-\hat F(y_{(k_ L)})}} (y_{(k_ L+1)}-y_{(k_ L)}) & \mbox{ if } \hat F(y_{(k_ L)}) \le \hat p_ L < \hat F(y_{(k_ L+1)}) \\ y_{(d)} & \mbox{ if } \hat p_ L=1 \end{array} \right. \]

and the $\hat p_ U$th quantile is defined as

\[ \hat Q(\hat p_ U)= \left\{ \begin{array}{ll} y_{(1)} & \mbox{ if } \hat p_ U<\hat F(y_{(1)}) \\ y_{(k_ U)}+\displaystyle {\frac{\hat p_ U-\hat F(y_{(k_ U)})}{\hat F(y_{(k_ U+1)})-\hat F(y_{(k_ U)})}} (y_{(k_ U+1)}-y_{(k_ U)}) & \mbox{ if } \hat F(y_{(k_ U)}) \le \hat p_ U < \hat F(y_{(k_ U+1)}) \\ y_{(d)} & \mbox{ if } \hat p_ U=1 \end{array} \right. \]

The standard error of $\hat Q(p)$ is then estimated by

\[ \hat{\mbox{StdErr}}(\hat Q(p)) = \frac{\hat Q(\hat p_ U) - \hat Q(\hat p_ L)}{2t_{\mi{df},\, \, \alpha /2}} \]

where $t_{\mi{df},\, \, \alpha /2}$ is the $100(1-\alpha /2)$th percentile of the t distribution with df degrees of freedom.

Replication Methods

When you use the jackknife replication method as described in the section Replication Methods for Variance Estimation, the following naive replication variance estimate for a quantile $\hat Q(p)$ can have poor properties:

\[ \widehat{V}(\hat Q(p)) = \sum _{r=1}^ R \alpha _ r \left( \hat Q^{(r)}(p) - {\hat Q(p)} \right)^2 \]

Here $\alpha _ r$ is a coefficient that corresponds to each replicate, R is the number of replicates, and $\hat Q^{(r)}(p)$ is the estimated quantile in the rth replicate.

Fuller (2009) proposes using a smoothing method similar to the following to modify the quantile estimates $\hat Q^{(r)}(p)$ for each replicate before using this naive variance estimate for a quantile $\hat Q(p)$.

In the rth replicate ($r=1, 2, \ldots , R$), denote $\{ y^{(r)}_{hij}, w^{(r)}_{hij}\} $ to be the observed values of variable Y that are associated with the replicate weights. Let $ y^{(r)}_{(1)} < y^{(r)}_{(2)} < \cdots < y^{(r)}_{(n^{(r)})}$ be the sample order statistics for variable Y in the rth replicate, where $n^{(r)}$ is the total number of observations whose replicate weights $w^{(r)}_{hij}>0$.

Let $\hat Q^{(r)}(p)$ be the estimated pth quantile and $\hat F^{(r)}(t)$ be the estimated cumulative distribution for Y,

\[ \hat Q^{(r)}(p)= \left\{ \begin{array}{ll} y^{(r)}_{(1)} & \mbox{ if } p<\hat F^{(r)}(y^{(r)}_{(1)}) \\ y^{(r)}_{(k)}+\displaystyle {\frac{p-\hat F^{(r)}(y^{(r)}_{(k)})}{\hat F^{(r)}(y^{(r)}_{(k+1)})-\hat F^{(r)}(y^{(r)}_{(k)})}} (y^{(r)}_{(k+1)}-y^{(r)}_{(k)}) & \mbox{ if } \hat F^{(r)}(y^{(r)}_{(k)}) \le p < \hat F^{(r)}(y^{(r)}_{(k+1)}) \\ y^{(r)}_{(n^{(r)})} & \mbox{ if } p=1 \end{array} \right. \]

and

\[ \hat F^{(r)}(t)=\frac{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}}w^{(r)}_{hij}I(y^{(r)}_{hij}\le t)}{\sum _{h=1}^ H\sum _{i=1}^{n_ h}\sum _{j=1}^{m_{hi}}w^{(r)}_{hij}} \]

where $I(\cdot )$ is the indicator function.

Choose a segment in the distribution function by two points, $\tilde p^{(r)}_ L$ and $\tilde p^{(r)}_ U$,

\begin{eqnarray*} \tilde p^{(r)}_ L & =& \max \left( \frac{w^{(r)}_{(1)}}{\sum _{h=1}^ H\sum _{i=1}^{n_ h}\sum _{j=1}^{m_{hi}}w^{(r)}_{hij}}, \, \, \, \hat F^{(r)}(\hat Q^{(r)}(p))-2\sqrt {p(1-p)/n^{(r)}} \right) \\ \tilde p^{(r)}_ U & =& \min \left(1, \, \, \, \hat F^{(r)}(\hat Q^{(r)}(p))+2\sqrt {p(1-p)/n^{(r)}} \right) \end{eqnarray*}

where $w^{(r)}_{(1)}$ is the replicate weight that corresponds to $y^{(r)}_{(1)}$ in the rth replicate. Then a modified pth quantile in the rth replicate is defined by

\[ \tilde Q^{(r)}(p) = \hat Q^{(r)}(\tilde p^{(r)}_ L) + \displaystyle {\frac{\hat Q^{(r)}(\tilde p^{(r)}_ U)-\hat Q^{(r)}(\tilde p^{(r)}_ L)}{\tilde p^{(r)}_ U-\tilde p^{(r)}_ L}} \left( {p-\tilde p^{(r)}_ L} \right) \]

PROC SURVEYMEANS then uses $\tilde Q^{(r)}(p)$ as the quantile estimate in the rth replicate and its deviation from the mean of $\tilde Q^{(r)}(p)$ to estimate the variance of $\hat Q(p)$:

\begin{eqnarray*} \widehat{V}(\hat Q(p)) & = & \sum _{r=1}^ R \alpha _ r \left( \tilde Q^{(r)}(p) - {\bar{\tilde Q}}(p) \right)^2 \\ {\bar{\tilde Q}}(p) & =& \frac{1}{R} \sum _{r=1}^ R \tilde Q^{(r)}(p) \end{eqnarray*}

If you want to use the naive replication variance estimates by using $\hat Q^{(r)}(p)$ instead of the smoothed $\tilde Q^{(r)}(p)$ to estimate the variance of $\hat Q(p)$, which are the default estimates before SAS/STAT 14.1, you can specify the method-option NAIVEQVAR as VARMETHOD=BRR(NAIVEQVAR) or VARMETHOD=JACKKNIFE(NAIVEQVAR) .

Confidence Limits

Symmetric $100(1-\alpha )$% confidence limits are computed as

\[ \left( \hat Q(p) - \hat{\mbox{StdErr}}(\hat Q(p)) ~ t_{\mi{df},\, \, \alpha /2} , \, \, \, \, \, \, \hat Q(p) + \hat{\mbox{StdErr}}(\hat Q(p)) ~ t_{\mi{df},\, \, \alpha /2} \right) \]

If you specify the NONSYMCL option in the PROC SURVEYMEANS  statement, when you use the VARMETHOD=TAYLOR option, the procedure computes $100(1-\alpha )$% nonsymmetric confidence limits:

\[ \left(\hat Q(\hat p_ L), \, \, \, \, \, \hat Q(\hat p_ U) \right) \]
Quantile Estimation with Poststratification

When you specify a POSTSTRATA statement, the quantile estimation and its variance estimation incorporate poststratification. For more information about poststratification, see the section Poststratification.

For a selected sample, let $r=1, 2, \ldots , R$ be the poststratum index; let $Z_1, Z_2, \ldots , Z_ R$ be the population totals for each corresponding poststratum, and let $I_ r$ be the indicator variable for the poststratum r that is defined by

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

Denote the total sum of original weights in the sample for each poststratum as

\[ \psi _ r = \sum _{h=1}^ H\sum _{i=1}^{n_ h}\sum _{j=1}^{m_{hi}} ~ w_{hij} I_{r}(h,i,j) \]

Assume that the observation (h, i, j) belongs to the rth poststratum. Then the poststratification weight for the observation (h, i, j) is

\[ \tilde{w}_{hij} = w_{hij} \frac{Z_ r}{\psi _ r} \]

Then the estimated cumulative distribution function of Y, $\hat F(t)$ and the estimated pth quantile estimation $\hat Q(p)$ can be computed as in the section Estimate of Quantile by replacing the original weights, $w_{hij}$, with the poststratification weights, $\tilde{w}_{hij}$.

When you specify VARMETHOD=TAYLOR (or by default), the variance of $\hat Q(p)$ is estimated as in the section Standard Error, except that the variance of the estimated distribution function $\hat F(\hat Q(p))$ is computed as follows.

For each poststratum $r=1, 2, \ldots , r$, define

\[ {\hat{\theta }}^{(r)}(\hat Q(p))= Z_ r^{-1} \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{r}(h,i,j) ~ \tilde{w}_{hij} ~ (I(y_{hij} \le \hat Q(p)) - \hat F(\hat Q(p))) \]

where $I(\cdot )$ is the indicator function.

Assume that the observation (h, i, j) belongs to the rth poststratum. Let

\[ \tilde{y}_{hij}=I(y_{hij} \le \hat Q(p)) - \hat F(\hat Q(p)) - {\hat{\theta }}^{(r)}(\hat Q(p)) \]

PROC SURVEYMEANS estimates the variance of the estimated distribution function $\hat F(\hat Q(p))$ with poststratification by

\[ \hat V(\hat F(\hat Q(p))) =\sum _{h=1}^ H \frac{n_ h(1-f_ h)}{n_ h-1} ~ \sum _{i=1}^{n_ h} {(u_{hi\cdot }-\bar{u}_{h\cdot \cdot })^2} \]

where

\begin{eqnarray*} u_{hi\cdot }& =& \left( \sum _{j=1}^{m_{hi}}\tilde{w}_{hij}~ \tilde{y}_{hij} \right) / ~ \tilde{w}_{\cdot \cdot \cdot } \\ \bar{u}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}u_{hi\cdot } \right) / ~ n_ h \\ \tilde{w}_{\cdot \cdot \cdot } & =& \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} \tilde{w}_{hij} \end{eqnarray*}
Domain Quantile

Let Y be the variable of interest in a complex survey, and let a subpopulation of interest be domain D. Denote $F_ D(t)$ as the cumulative distribution function of Y in domain D. For $0<p<1$, the pth quantile of the population cumulative distribution function is

\[ Q_ D(p)=\inf \{ y: F_ D(y)\ge p\} \]

Let $I_ D$ be the corresponding indicator variable:

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

Assume that there are a total of d observations among the n observations in the entire sample that belong to domain D. Let $ y_{(1)} < y_{(2)} < \cdots < y_{(d)}$ denote the order statistics of variable Y for these d observations that fall in domain D.

The cumulative distribution function of Y in domain D is estimated by

\[ \hat F_ D(t)=\frac{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}}w_{hij}I(y_{hij}\le t)I_{D}(h,i,j)}{\sum _{h=1}^ H\sum _{i=1}^{n_ h}\sum _{j=1}^{m_{hi}}w_{hij}I_{D}(h,i,j)} \]

and $I(\cdot )$ is the indicator function. Then the estimated quantile in domain D is

\[ \hat Q_ D(p)= \left\{ \begin{array}{ll} y_{(1)} & \mbox{ if } p<\hat F_ D(y_{(1)}) \\ y_{(k)}+\displaystyle {\frac{p-\hat F_ D(y_{(k)})}{\hat F_ D(y_{(k+1)})-\hat F_ D(y_{(k)})}} (y_{(k+1)}-y_{(k)}) & \mbox{ if } \hat F_ D(y_{(k)}) \le p < \hat F_ D(y_{(k+1)}) \\ y_{(d)} & \mbox{ if } p=1 \end{array} \right. \]

In order to estimate the variance for $\hat Q_ D(p)$, PROC SURVEYMEANS first estimates the variance of the estimated distribution function $\hat F_ D(\hat Q_ D(p))$ in domain D. When you specify VARMETHOD=TAYLOR (or by default), the variance of $\hat F_ D(\hat Q_ D(p))$ is estimated by

\[ \hat V(\hat F_ D(\hat Q_ D(p))) =\sum _{h=1}^ H \frac{n_ h(1-f_ h)}{n_ h-1} ~ \sum _{i=1}^{n_ h} {(d_{hi\cdot }-\bar{d}_{h\cdot \cdot })^2} \]

where

\begin{eqnarray*} v_{hij} & =& I_{D}(h,i,j) w_{hij} \\ v_{\cdot \cdot \cdot } & =& \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} v_{hij} \\ d_{hi\cdot }& =& \left( \sum _{j=1}^{m_{hi}}v_{hij}~ (I(y_{hij} \le \hat Q_ D(p)) - \hat F_ D(\hat Q_ D(p))) \right) / ~ v_{\cdot \cdot \cdot } \\ \bar{d}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}d_{hi\cdot } \right) / ~ n_ h \end{eqnarray*}

Then $100(1-\alpha )$% confidence limits for $\hat F_ D(\hat Q_ D(p))$ can be constructed by $(\hat{p}_{DL}, \hat{p}_{DU})$, where

\begin{eqnarray*} \hat{p}_{DL} & =& \hat F_ D(\hat Q_ D(p)) -t_{\mi{df},\, \, \alpha /2}\sqrt {\hat V(\hat F_ D(\hat Q_ D(p)))} \\ \hat{p}_{DU} & =& \hat F_ D(\hat Q_ D(p)) +t_{\mi{df},\, \, \alpha /2}\sqrt {\hat V(\hat F_ D(\hat Q_ D(p)))} \end{eqnarray*}

and $t_{\mi{df},\, \, \alpha /2}$ is the $100(1-\alpha /2)$th percentile of the t distribution with df degrees of freedom, described in the section Degrees of Freedom. When $(\hat{p}_{DL}, \hat{p}_{DU})$ is out of the range of [0,1], PROC SURVEYMEANS does not compute the standard error of $\hat Q_ D(p)$.

The $\hat{p}_{DL}$th quantile is then estimated as

\[ \hat Q_ D(\hat{p}_{DL})= \left\{ \begin{array}{ll} y_{(1)} & \mbox{ if } \hat{p}_{DL}<\hat F_ D(y_{(1)}) \\ y_{(k_ L)}+\displaystyle {\frac{(\hat{p}_{DL}-\hat F_ D(y_{(k_ L)}))(y_{(k_ L+1)}-y_{(k_ L)})}{\hat F_ D(y_{(k_ L+1)})-\hat F_ D(y_{(k_ L)})}} & \mbox{ if } \hat F_ D(y_{(k_ L)}) \le \hat p_{DL} < \hat F_ D(y_{(k_ L+1)}) \\ y_{(d)} & \mbox{ if } \hat p_{DL}=1 \end{array} \right. \]

The $\hat{p}_{DU}$th quantile is then estimated as

\[ \hat Q_ D(\hat{p}_{DU})= \left\{ \begin{array}{ll} y_{(1)} & \mbox{ if } \hat{p}_{DU}<\hat F_ D(y_{(1)}) \\ y_{(k_ U)}+\displaystyle {\frac{(\hat{p}_{DU}-\hat F_ D(y_{(k_ U)}))(y_{(k_ U+1)}-y_{(k_ U)})}{\hat F_ D(y_{(k_ U+1)})-\hat F_ D(y_{(k_ U)})}} & \mbox{ if } \hat F_ D(y_{(k_ U)}) \le \hat p_{DU} < \hat F_ D(y_{(k_ U+1)}) \\ y_{(d)} & \mbox{ if } \hat p_{DU}=1 \end{array} \right. \]

The standard error of $\hat Q_ D(p)$ is then estimated by

\[ \hat{\mbox{StdErr}}(\hat Q_ D(p)) = \frac{\hat Q_ D(\hat{p}_{DU}) - \hat Q_ D(\hat{p}_{DL})}{2t_{\mi{df},\, \, \alpha /2}} \]

where $t_{\mi{df},\, \, \alpha /2}$ is the $100(1-\alpha /2)$th percentile of the t distribution with df degrees of freedom.

Symmetric $100(1-\alpha )$% confidence limits for $\hat Q_ D(p)$ are computed as

\[ \left( \hat Q_ D(p) - \hat{\mbox{StdErr}}(\hat Q_ D(p)) ~ t_{\mi{df},\, \, \alpha /2} , \, \, \, \, \, \, \hat Q_ D(p) + \hat{\mbox{StdErr}}(\hat Q_ D(p)) ~ t_{\mi{df},\, \, \alpha /2} \right) \]

If you specify the NONSYMCL option in the PROC SURVEYMEANS statement, the procedure displays $100(1-\alpha )$% nonsymmetric confidence limits as

\[ \left(\hat Q_ D(\hat{p}_{DL}), \, \, \, \, \, \hat Q_ D(\hat{p}_{DU}) \right) \]
Domain Quantile Estimation with Poststratification

When you specify both a POSTSTRATA statement and a DOMAIN statement, the domain quantile estimation and its variance estimation incorporate poststratification. For more information about poststratification, see the section Poststratification.

For a selected sample, let $r=1, 2, \ldots , R$ be the poststratum index, let $Z_1, Z_2, \ldots , Z_ R$ be the population totals for each corresponding poststratum, and let $I_ r$ be the indicator variable for the poststratum r:

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

The poststratification weights, $\tilde{w}_{hij}$, are defined as in the section Quantile Estimation with Poststratification.

For 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)\mbox{ belongs to } D \\ 0 & \mbox{otherwise} \end{array} \right. \]

With poststratification, for variable Y, the estimated cumulative distribution in domain D, $\hat F_ D(t)$, and its pth quantile estimation, $\hat Q_ D(p)$, can be computed as in the section Domain Quantile by replacing the original weights, $w_{hij}$, with the poststratification weights, $\tilde{w}_{hij}$. However, the variance of $\hat F_ D(\hat Q_ D(p))$, which is described in the section Domain Quantile, is computed as follows when you specify the VARMETHOD=TAYLOR option (or by default).

Define

\begin{eqnarray*} {\hat{\theta }}^{(r)}_ D(\hat Q_ D(p))& =& Z_ r^{-1} \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{D}(h,i,j) I_{r}(h,i,j) ~ \tilde{w}_{hij} ~ (I(y_{hij} \le \hat Q_ D(p)) - \hat F_ D(\hat Q_ D(p))) \\ {\hat{\bar{I}}}_{D}^{(r)} & = & Z_ r^{-1} \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{r}(h,i,j) ~ I_{D}(h,i,j) ~ \tilde{w}_{hij} \\ \hat\theta _ D(p) & =& \frac{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{D}(h,i,j) ~ \tilde{w}_{hij} ~ (I(y_{hij} \le \hat Q_ D(p)) - \hat F_ D(\hat Q_ D(p))) }{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{D}(h,i,j) ~ \tilde{w}_{hij}} \end{eqnarray*}

Assume that the observation (h, i, j) belongs to the rth poststratum. Then the variance of $\hat F_ D(\hat Q_ D(p))$ is estimated by

\begin{eqnarray*} \hat V(\hat F_ D(\hat Q_ D(p))) & =& \sum _{h=1}^ H \frac{n_ h(1-f_ h)}{n_ h-1} ~ \sum _{i=1}^{n_ h} {(e_{hi\cdot }-\bar{e}_{h\cdot \cdot })^2} \\ e_{hij} & =& I_ D(h,i,j) \left( I(y_{hij} \le \hat Q_ D(p)) - \hat F_ D(\hat Q_ D(p))\right) ~ -~ {\hat{\theta }}^{(r)}_ D(\hat Q_ D(p)) \\ & & ~ -~ \left( ~ I_ D(h,i,j) ~ -~ {\hat{\bar{I}}}_{D}^{(r)} ~ \right) ~ \hat\theta _ D(p) \\ e_{hi\cdot }& =& \sum _{j=1}^{m_{hi}}~ \tilde{w}_{hij} e_{hij} /\tilde{w}_{\cdot \cdot \cdot } \\ \bar{e}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}e_{hi\cdot } \right) / ~ n_ h \end{eqnarray*}

Geometric Mean

For a continuous variable Y that has positive values, the SURVEYMEANS procedure can compute its geometric mean and associated standard error and confidence limits. To request these statistics, you can specify statistic-keywords such as GEOMEAN, GMSTDERR, and GMCLM.

The geometric mean of Y from a sample is computed as

\begin{eqnarray*} \widehat{\bar{Y}}_ G & = & \left(\prod _{h=1}^ H\prod _{i=1}^{n_ h} \prod _{j=1}^{m_{hi}} ~ {y_{hij}}^{ w_{hij}} \right)^{\frac{1}{w_{\cdot \cdot \cdot }}} \\ & = & \exp \left( {\frac{1}{w_{\cdot \cdot \cdot }}} \sum _{h=1}^ H\sum _{i=1}^{n_ h}\sum _{j=1}^{m_{hi}}{w_{hij} \ln (y_{hij})} \right) \end{eqnarray*}

where

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

is the sum of the weights over all observations in the data set.

When you use the Taylor series method, the variance estimation for the geometric mean is computed as

\begin{eqnarray*} \hat{V}(\widehat{\bar{Y}}_ G) & = & \left( \widehat{\bar{Y}}_ G \right) ^2 \sum _{h=1}^ H{\frac{n_ h(1-f_ h)}{n_ h-1} ~ \sum _{i=1}^{n_ h} {(r_{hi\cdot }-\bar{r}_{h\cdot \cdot })^2}} \end{eqnarray*}

where

\begin{eqnarray*} r_{hi\cdot }& =& \left( \sum _{j=1}^{m_{hi}}w_{hij}~ (\ln (y_{hij})- \ln (\widehat{\bar{Y}}_ G)) \right) / ~ w_{\cdot \cdot \cdot } \\ \bar{r}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}r_{hi\cdot } \right) / ~ n_ h \end{eqnarray*}

The standard error of the geometric mean is the square root of the estimated variance:

\[ \mbox{StdErr}(\widehat{{\bar{Y_ G}}})= \sqrt {\hat{V}(\widehat{\bar{Y}}_ G)} \]

The confidence limits for the geometric means are computed based on the confidence limits for the log transformation of the Y variable as

\[ \left( \exp ( \ln (\widehat{\bar{Y}}_ G) ~ - ~ \gamma ), ~ ~ ~ ~ \exp ( \ln (\widehat{\bar{Y}}_ G) ~ + ~ \gamma ) \right) \]

where

\[ \gamma = t_{\mi{df},\, \, \alpha /2} * \mbox{StdErr}(\widehat{{\bar{Y_ G}}}) / \widehat{\bar{Y}}_ G \]

and $t_{\mi{df},\, \, \alpha /2}$ is the $100(1-\alpha /2)$th percentile of the t distribution, with df calculated as in the section t Test for the Mean.

If you use replication methods to estimate the variance by specifying VARMETHOD=BRR or VARMETHOD=JACKKNIFE , the procedure computes the variance of a geometric means $\hat{V_ R}(\widehat{\bar{Y}}_ G)$ by using the variability among replicate estimates to estimate the overall variance. See the section Replication Methods for Variance Estimation for more information.

Then the standard error is the square root of the estimated variance:

\[ \mbox{StdErr}_ R(\widehat{{\bar{Y_ G}}})= \sqrt {\hat{V_ R}(\widehat{\bar{Y}}_ G)} \]

The confidence limits for the geometric means are computed based on the confidence limits for the log transformation of the variable Y as

\[ \left( \exp ( \ln (\widehat{\bar{Y}}_ G) ~ - ~ \lambda ), ~ ~ ~ ~ \exp ( \ln (\widehat{\bar{Y}}_ G) ~ + ~ \lambda ) \right) \]

where

\[ \lambda = t_{\mi{df},\, \, \alpha /2} * \mbox{StdErr}_ R (\widehat{{\bar{Y_ G}}}) / \widehat{{\bar{Y_ G}}} \]

and $t_{\mi{df},\, \, \alpha /2}$ is the $100(1-\alpha /2)$th percentile of the t distribution, with df calculated as in the section t Test for the Mean.

Poststratification

After a probability sample is drawn and survey data are collected, researchers sometimes want to stratify the sample according to auxiliary information about the sampled population. This process is often called poststratification.

When poststratification is done properly, it can improve efficiency. It can also be used to adjust the sampling weights such that the marginal distribution of the sampling weights is in agreement with known auxiliary information from other resources, such as the census. The adjusted weight is often called the poststratification weight. It is quite common for researchers to use poststratification techniques in survey data analysis.

Poststratification is also used by epidemiologists, who frequently analyze health survey data. They often compute statistics based on a process called direct standardization, a form of poststratification. For example, certain diseases, such as cancer, are more common among older populations. Therefore, to compare the prevalence rates among geographic regions that are populated with different age groups, it is necessary to make adjustments according to such demographic categories and to compute relative prevalence rates of the diseases.

For more information about poststratification, see Fuller (2009); Lohr (2010); Wolter (2007); Rao, Yung, and Hidiroglou (2002).

After you provide the population controls for each poststratum that is defined by the poststratification variables, the SURVEYMEANS procedure creates the poststratification weights accordingly. Then the procedure computes statistics that you request by using poststratification weights.

You can save the poststratification weights in an OUTPSWGT= data set to be used in subsequent analyses.

For a selected sample, let $p=1, 2, \ldots , P$ be the poststratum index; let $Z_1, Z_2, \ldots , Z_ P$ be the population totals for the corresponding poststrata; and let $I_ p$ be a corresponding indicator variable for poststratum p defined by

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

Denote the total sum of original weights in the sample for each poststratum as

\[ \psi _ p = \sum _{h=1}^ H\sum _{i=1}^{n_ h}\sum _{j=1}^{m_{hi}} ~ w_{hij} I_{p}(h,i,j) \]

Then the poststratification weight for observation (h, i, j) is

\[ \tilde{w}_{hij} = w_{hij} \frac{Z_ p}{\psi _ p} \]

The SURVEYMEANS procedure computes statistics by using the poststratification weights $\tilde{w}_{hij}$ instead of the original weights $w_{hij}$.

The standard error and confidence intervals of computed statistics are based on the estimated variances, which are computed by using either a replication method or the Taylor series method.

Replication Methods

When you specify VARMETHOD=BRR or VARMETHOD=JACKKNIFE , PROC SURVEYMEANS computes the variance of a statistic by using replication methods, as described in the section Replication Methods for Variance Estimation. However, with poststratification, an extra step is needed to adjust the weights.

First, PROC SURVEYMEANS constructs a replicate and computes appropriate replicate weights for the replicate. Then, by using the poststratification control totals, the procedure adjusts these replicate weights in the same way as described previously for constructing the poststratification weights for the full sample. Finally, PROC SURVEYMEANS computes the estimate for a desired statistics by using the poststratification weights that are adjusted from the replicate weights in the current replicate. Then the final variance is estimated by the variability among replicate estimates, as described in the section Replication Methods for Variance Estimation.

Taylor Series Method

When you specify VARMETHOD=TAYLOR , or by default when you do not specify the VARMETHOD= option, PROC SURVEYMEANS uses the Taylor series method to estimate the variances of requested statistics.

Variance of the Mean and Sum

The sum and mean of variable Y under poststratification are

\begin{eqnarray*} {\hat{{Y}}}^{(PS)} & = & \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ \tilde{w}_{hij} ~ y_{hij} \\ {\hat{\bar{Y}}}^{(PS)} & = & {\hat{{Y}}}^{(PS)} / ~ \tilde{w}_{\cdot \cdot \cdot } \end{eqnarray*}

where

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

is the sum of the poststratification weights over all observations in the sample.

For each poststratum $p=1, 2, \ldots , P$, let the mean of variable Y be

\[ {\hat{\bar{Y}}}^{(p)} = \left( \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{p}(h,i,j) ~ \tilde{w}_{hij} ~ y_{hij} \right) / ~ Z_ p \]

where $Z_ p$ is the total of the poststratification weights in poststratum p.

For observation (h, i, j), assume that it belongs to the pth poststratum. Let

\[ \tilde{y}_{hij}=y_{hij}- \hat{\bar{Y}}^{(p)} \]

PROC SURVEYMEANS estimates the variance of ${\hat{\bar{Y}}}^{(PS)}$ as

\[ \hat{V}\left({\hat{\bar{Y}}}^{(PS)}\right) =\sum _{h=1}^ H {\hat{V}_ h \left({\hat{\bar{Y}}}^{(PS)}\right)} \]

where, if $n_ h>1$, then

\begin{eqnarray*} \hat{V}_ h \left({\hat{\bar{Y}}}^{(PS)}\right) & = & \frac{n_ h(1-f_ h)}{n_ h-1} ~ \sum _{i=1}^{n_ h} {(e_{hi\cdot }-\bar{e}_{h\cdot \cdot })^2} \\ e_{hi\cdot }& =& \left( \sum _{j=1}^{m_{hi}} \tilde{w}_{hij} ~ \tilde{y}_{hij} \right) / \tilde{w}_{\cdot \cdot \cdot } \\ \bar{e}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}e_{hi\cdot } \right) / ~ n_ h \end{eqnarray*}

and if $n_ h=1$, then

\[ \hat{V}_ h \left({\hat{\bar{Y}}}^{(PS)}\right) = \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. \]

PROC SURVEYMEANS estimates the variance of ${\hat{{Y}}}^{(PS)}$ as

\[ \hat{V}_ h \left({\hat{{Y}}}^{(PS)}\right) = \hat{V}_ h \left({\hat{\bar{Y}}}^{(PS)}\right) ~ {\tilde{w}}_{\cdot \cdot \cdot }^2 \]
Variance of the Domain Mean and Sum

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)\mbox{ belongs to } D \\ 0 & \mbox{otherwise} \end{array} \right. \]

Let

\[ \tilde{v}_{hij}= \tilde{w}_{hij}I_ D(h,i,j) = \left\{ \begin{array}{ll} \tilde{w}_{hij} & \mbox{if observation }(h,i,j)\mbox{ belongs to } D \\ 0 & \mbox{otherwise} \end{array} \right. \]

The sum and mean of variable Y under poststratification in domain D are

\begin{eqnarray*} {\hat{{Y}}_ D}^{(PS)} & = & \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ \tilde{v}_{hij} ~ y_{hij} \\ {\hat{\bar{Y}}_ D}^{(PS)} & = & {\hat{{Y}}_ D}^{(PS)} / ~ \tilde{v}_{\cdot \cdot \cdot } \end{eqnarray*}

where

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

is the sum of the poststratification weights over all observations in the sample in domain D. For each poststratum $p=1, 2, \ldots , P$, let the mean of variable Y and the mean of the domain indicator variable in each poststratum be

\begin{eqnarray*} {\hat{\bar{Y}}}_{D}^{(p)} & = & \left(\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{p}(h,i,j) ~ I_{D}(h,i,j) ~ \tilde{w}_{hij} ~ y_{hij} \right) / ~ Z_ p \\ {\hat{\bar{I}}}_{D}^{(p)} & = & \left(\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{p}(h,i,j) ~ I_{D}(h,i,j) ~ \tilde{w}_{hij} \right) / ~ Z_ p \end{eqnarray*}

Assume that the observation (h, i, j) belongs to the pth poststratum. Let

\begin{eqnarray*} d_{hij} & =& y_{hij}I_ D(h,i,j) ~ -~ {\hat{\bar{Y}}}_{D}^{(p)} \\ e_{hij} & =& d_{hij} ~ -~ \left( ~ I_ D(h,i,j) ~ -~ {\hat{\bar{I}}}_{D}^{(p)} ~ \right) ~ {\hat{\bar{Y}}_ D}^{(PS)} \end{eqnarray*}

Then PROC SURVEYMEANS estimates the variance of domain sum ${\hat{{Y}}_ D}^{(PS)}$ as

\[ \hat{V}\left({\hat{{Y}}_ D}^{(PS)}\right) =\sum _{h=1}^ H {\hat{V}_ h \left({\hat{{Y}}_ D}^{(PS)}\right)} \]

where, if $n_ h>1$, then

\begin{eqnarray*} \hat{V}_ h \left({\hat{{Y}}_ D}^{(PS)}\right) & = & \frac{n_ h(1-f_ h)}{n_ h-1} ~ \sum _{i=1}^{n_ h} {(d_{hi\cdot }-\bar{d}_{h\cdot \cdot })^2} \\ d_{hi\cdot }& =& \sum _{j=1}^{m_{hi}}~ \tilde{w}_{hij} d_{hij} \\ \bar{d}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}d_{hi\cdot } \right) / ~ n_ h \end{eqnarray*}

and if $n_ h=1$, then

\[ \hat{V}_ h \left({\hat{{Y}}_ D}^{(PS)}\right) = \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. \]

Then PROC SURVEYMEANS estimates the variance of domain mean ${\hat{\bar{Y}}_ D}^{(PS)}$ as

\[ \hat{V}\left({\hat{\bar{Y}}_ D}^{(PS)}\right) =\sum _{h=1}^ H {\hat{V}_ h \left({\hat{\bar{Y}}_ D}^{(PS)}\right)} \]

where, if $n_ h>1$, then

\begin{eqnarray*} \hat{V}_ h \left({\hat{\bar{Y}}_ D}^{(PS)}\right) & = & \frac{n_ h(1-f_ h)}{n_ h-1} ~ \sum _{i=1}^{n_ h} {(e_{hi\cdot }-\bar{e}_{h\cdot \cdot })^2} \\ e_{hi\cdot }& =& \sum _{j=1}^{m_{hi}}~ \tilde{w}_{hij} e_{hij} /\tilde{w}_{\cdot \cdot \cdot } \\ \bar{e}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}e_{hi\cdot } \right) / ~ n_ h \end{eqnarray*}

and if $n_ h=1$, then

\[ \hat{V}_ h \left({\hat{\bar{Y}}_ D}^{(PS)}\right) = \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. \]
Variance of the Ratio

Suppose you want to calculate the ratio of variable Y to variable X. Let $x_{hij}$ and $y_{hij}$ be the values of variable X and variable Y, respectively, for observation (h, i, j).

The ratio of Y to X after poststratification is

\[ \hat{R}^{(PS)} = \frac{ \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ \tilde{w}_{hij} ~ y_{hij} }{ \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ \tilde{w}_{hij} ~ x_{hij} } \]

where $\tilde{w}_{hij}$ is the poststratification weight for observation $(h, i, j)$.

Assume that the observation (h, i, j) belongs to the pth poststratum. Let

\begin{eqnarray*} \tilde{y}_{hij} & =& y_{hij}- \hat{\bar{Y}}^{(p)} \\ \tilde{x}_{hij} & =& x_{hij}- \hat{\bar{X}}^{(p)} \end{eqnarray*}

where $\hat{\bar{Y}}^{(p)}$ and $\hat{\bar{X}}^{(p)}$ are the means of variable Y and variable X, respectively, in poststratum p.

The variance of $\hat{R}^{(PS)}$ is estimated by

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

where, if $n_ h>1$, then

\begin{eqnarray*} \hat{V_ h}(\hat{R}^{(PS)}) & =& \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}}\tilde{w}_{hij}~ (\tilde{y}_{hij}- \tilde{x}_{hij}\hat{R}^{(PS)}) }{\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ \tilde{w}_{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

\[ \hat{V_ h}(\hat{R}^{(PS)}) = \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. \]
Variance of the Domain Ratio

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)\mbox{ belongs to } D \\ 0 & \mbox{otherwise} \end{array} \right. \]

Let

\[ \tilde{v}_{hij}= \tilde{w}_{hij}I_ D(h,i,j) = \left\{ \begin{array}{ll} \tilde{w}_{hij} & \mbox{if observation }(h,i,j)\mbox{ belongs to } D \\ 0 & \mbox{otherwise} \end{array} \right. \]

The ratio of variable Y to variable X in domain D after poststratification is estimated by

\[ {\hat{R}}_ D^{(PS)} = \frac{ \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ \tilde{w}_{hij} ~ y_{hij} ~ I_ D(h,i,j) }{ \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ \tilde{w}_{hij} ~ x_{hij} ~ I_ D(h,i,j) } \]

For each poststratum $p=1, 2, \ldots , P$, let the mean of variable X and Y in each poststratum be

\begin{eqnarray*} {\hat{\bar{Y}}}_{D}^{(p)} & = & \left(\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{p}(h,i,j) ~ \tilde{v}_{hij} ~ x_{hij} \right) / ~ Z_ p \\ {\hat{\bar{X}}}_{D}^{(p)} & = & \left(\sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ I_{p}(h,i,j) ~ \tilde{v}_{hij} ~ y_{hij} \right) / ~ Z_ p \end{eqnarray*}

Assume that the observation (h, i, j) belongs to the pth poststratum. Let

\[ r_{hij} = y_{hij}I_ D(h,i,j) ~ -~ {\hat{\bar{Y}}}_{D}^{(p)} ~ -~ \left( ~ x_{hij}I_ D(h,i,j) ~ -~ {\hat{\bar{X}}}_{D}^{(p)} ~ \right) ~ {\hat{R}}_ D^{(PS)} \]

Then PROC SURVEYMEANS estimates the variance of domain ratio ${\hat{R}}_ D^{(PS)}$ after poststratification as

\[ \hat{V}\left({\hat{R}}_ D^{(PS)}\right) =\sum _{h=1}^ H {\hat{V}_ h \left({\hat{{R}}_ D}^{(PS)}\right)} \]

where, if $n_ h>1$, then

\begin{eqnarray*} \hat{V}_ h \left({\hat{R}}_ D^{(PS)}\right) & = & \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 }& =& \sum _{j=1}^{m_{hi}}~ \tilde{w}_{hij} r_{hij} / \sum _{h=1}^ H\sum _{i=1}^{n_ h} \sum _{j=1}^{m_{hi}} ~ \tilde{v}_{hij} ~ x_{hij} \\ \bar{r}_{h\cdot \cdot } & =& \left( \sum _{i=1}^{n_ h}r_{hi\cdot } \right) \big / ~ n_ h \end{eqnarray*}

and if $n_ h=1$, then

\[ \hat{V}_ h \left({\hat{R}}_ D^{(PS)}\right) = \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. \]