# calculate properly statistical moments with stratified sample data

I have problems of how to calculate properly the third and fourth order moments: my data is a stratified sampling with three strata.

The goal for me is to make a descriptive analysis: mean, variance, coefficient of variation, the problems become when I try calculate the skewness and kurtosis.

Here the notation and math that I follow:

$\bar X _h$ = sample mean in stratum h

$x_h$ = total sample in stratum h.

$N_h$ = population size of stratum h.

$n_h$ = sample size of stratum h.

$fe_h$ = elevation factor in stratum h.

To calculate:

Total population: $\hat X_{st} = \sum ^{L} _{h=1} \hat x _h = \sum ^L _{h=1} N_h \bar x_h = \sum ^L _{h=1} \frac{N_h}{n_h} x_h = \sum^L_{h=1} fe_hx_h$

Mean population: $\hat{\bar{X}}_{st} = \bar x_{st} = \sum^L_{h=1} W_h \bar x_h = \sum ^L_{h=1} \frac{N_h}{N} \frac{1}{n_h}x_h = \frac{1}{N} \sum^L_{h=1} \frac{N_h}{n_h}x_h = \frac{1}{N} \sum^L_{h=1} fe_h x_h$

$\hat V (\hat X_{st}) = \sum ^L_{h=1} N^2_h(1-f_h) \frac{\hat S_h^2}{n_h}$

$\hat V (\hat{\bar{X}}_{st}) = \sum ^L_{h=1} W^2_h(1-f_h) \frac{\hat S_h^2}{n_h}$

where $\hat S ^2_h$ is sample quasivariance of stratum h.

So, how should I proceed to calculate the moments of third and fourth order (unbiased?) with this type of data.

I appreciate any help, guidance or feedback.

• It isn't clear to me what kind of guidance or feedback you are asking for, could you clarify? You might also want to read our help center to see what questions are on-topic here - questions purely about how to implement in Stata/R/ython are not good fits for our site. – Silverfish Aug 3 '16 at 12:29
• I'm sorry may be I try to explain me well, that I forget the main issue: I don't know how calculate moments 3rd and 4th order (Kurtosis, Skewness and gini but less important) with statified sample data. – mmngreco Aug 3 '16 at 12:58
• I suggest you edit your question to focus on your main statistical issue. – Silverfish Aug 3 '16 at 13:00
• Thanks for you feedback @Silverfish, I edited the question I hope looks better now. – mmngreco Aug 3 '16 at 16:06

You may be confusing

1. the population vs. the sample moments, on one hand, and
2. the population variance and the variance of the estimate of the mean (which involves the strata variances... unfortunately... as well as a lot of other stuff like finite population corrections $1-f_h$).

The population moment of order $k$ is, obviously (with some abuse of notation switching between the flat population and the stratified population): $$M_k = \frac{1}{N} \sum_{i=1}^N x_i^k = \sum_{h=1}^L \sum_{i=1}^{N_h} x_{hi}^k \Bigl/ \sum_{h=1}^L N_h$$

The population variance is $$V = M_2 - M_1^2$$

The population skewness (I made up the letter) is $$\Gamma = \frac{M_3 - 3 M_2 M_1 + 2 M_1^3}{(M_2 - M_1^2)^{3/2}}$$

The population kurtosis is $$K = \frac{M_4 - 2 M_2 M_1^2 + M_1^4}{(M_2 - M_1^2)^2}$$

The raw moments are estimable with their plug-in analogues (with abuse of notation, again, with the index $i$ running over the sample now): $$\hat M_k = \sum_{h=1}^L \sum_{i=1}^{n_h} w_{hi} x_{hi}^k \Bigl/ \sum_{h=1}^L \sum_{i=1}^{n_h} w_{hi}$$ ($w_{hi}$ are the analysis weights that you referred to as elevation factors $fe_h$ -- I honestly wonder what discipline you come from to call them these way; please, please comment below and let me know; in the simplest case of a simple random sample with no nonresponse, $w_{hi}=N_h=/n_h$).

Unless your sample sizes were fixed by the sampling design, the estimated moments $\hat M_K$, being ratios of random variables, are biased estimators of their target quantities. The biases are of the order $O(1/n)$, vs. the sampling error of the order $O(1/\sqrt{n})$, and hence disappear asymptotically. The plug-in estimates of skewness and kurtosis are also biased, and their biases also disappear asymptotically. The standard errors around $\hat M_k$, $\hat \Gamma$, $\hat K$ can be obtained by the delta method / Taylor series linearization. If I needed them (I am a lucky Stata user), I would just

svyset [pw=fe_h], strata(strata)
forvalues k=2/4 {
generate x_k' = x^k'
}
svy: mean x x_2 x_3 x_4
nlcom (skew: (_b[x_3]-3*_b[x_2]*_b[x]+2*_b[x]*_b[x]*_b[x])/( (_b[x_2]-_b[x]*_b[x])^(3/2) ) )


and Stata would produce the required standard errors that take stratification into account. Note that the standard errors for the moments of order $k$ (implicitly) rely on the population moments of order $2k$, so they won't be very stable/accurate.

Depending on what's available to you, some references may be helpful as introductory reading on analysis of survey data:

1. Korn and Graubard (1995 JRSS-A)
2. Korn and Graubard (1999 Wiley book)
3. Heeringa, West and Berglund (2010 Chapman and Hall)
4. Kolenikov and Pitblado (2014 chapter in Wiley handbook) -- that would be me; a copy can be found on ResearchGate.
• About the notation, as far as I know, $fe_h = \frac{N_h}{n_h}$ comes from Institute of Fiscal Studies of Spain, (Instituo de Estudios Fiscales: ief.es) matter of Economy more concretly about Fiscality, here pdf at the page 6 you find the notation in spanish. Only to clear any doubt (with all that notation it's easy get wrong), the weight that you refer is $w_{hi} = fe_{i} = N_h / n_{i}$ rather than $w_{hi} = N_h / N$, it's correct? Thanks for you time, and disposition, your answer was very useful. – mmngreco Aug 9 '16 at 18:23
• Yes, the first expression is what I meant. The knowledge of survey sampling by economists is generally dismal, and that is very, very unfortunate -- given how advanced economists are with quantitative methods. I heard "expansion weights" used; may be that's what the translation from Spanish could have been, too. – StasK Aug 9 '16 at 18:30
• Thanks again. Yes, in my case I didn't see any about survey sample at the economy grade. In addition, I needing calculate the gini index too, you can recommend any bibliography to consult about this issue? . – mmngreco Aug 10 '16 at 7:53
• You need to post this as a separate question. – StasK Aug 10 '16 at 12:42