Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: How to test for equality of variance in data with sampling weights

From   Steven Samuels <>
Subject   Re: st: How to test for equality of variance in data with sampling weights
Date   Fri, 25 May 2007 11:43:35 -0400

Stas, I too use -nl- for this use. It turns out to give an incorrect standard errors unless the income variable is first standardized by subtracting out the estimated mean or something close to it. I'll send you privately the log which shows this. I already reported the issue as a bug to Stata.


On May 25, 2007, at 11:17 AM, Stas Kolenikov wrote:

The substantive answer to your question would run as follows: the
variance is a function of moments (the second moment minus the square
of the first moment), so what you could do is

gen income2 = income*income
svy: mean income2 income, over(whatevergroup)
* over groups
nlcom [income2]1 - ([income]1)^2
* between groups
testnl ([income2]1 - ([income]1)^2 = [income2]2 - ([income]2)^2 )

The syntax is very tentative of course -- you would need to fill in a
lot of details. But you really need to take care of all the design
features, as Steven insists.

The World Bank should get a methodology division to be able to answer
questions like that internally -- I was surprised that you guys don't
have any.

On 5/16/07, <> wrote:
Dear statalist users,

I am faced with a problem for which I have not been able to find a solution yet,
neither in statalist archives nor through googling, (even though it does not
strike me as something extremely fancy that I am trying)

I am working with household survey data, where the sample is not clustered, not
stratified, but has sampling weights. Ultimately, I would like to test the
equality of the variance of my labor wage variable
1) for the whole sample and for specific subgroups (such as age groups) over
2) for subgroups at the same point in time.

I am aware of the command "robvar" but
a) it does not feature weights
b) I am wondering if it is statistically appropriate to pool my data for two
years and specify 'year' as the groupvar in the by() option.

What would you advise me? Is there another command implemented?
Thank you very much in advance,


* For searches and help try:

Stas Kolenikov
*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index