Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: stumped with lincom after svymean


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: stumped with lincom after svymean
Date   Tue, 31 Aug 2004 16:42:25 -0500

Hong <[email protected]> asks about comparing multiple means from survey data:

> How about the question 2 of Robert? Below is the question:
> 
> >2 - Is it possible to estimate a one-way anova to detect group differences 
> > with svy commands in Stata 8 based on my above example?
> 
> In Robert's example, variable x has three categories: 0, 1, and 2. Is there
> any way to compare the three group differences concurrently (like a one-way
> anova) with svy commands?

I believe this can be accomplished using either -svymean- or -svyregress- with
-test-.  Here is an example, using the auto data:

	. sysuse auto, clear
	. svyset, srs
	. keep if rep>2

	. quietly svymean mpg, by(rep)
	. test [mpg]3=[mpg]4=[mpg]5

	. quietly xi : svyregress mpg i.rep
	. test ([#1])

Here are the results from the above code:

***** BEGIN:
. sysuse auto, clear
(1978 Automobile Data)
 
. svyset, srs
simple random sample (SRS)
 
. keep if rep>2
(10 observations deleted)
 
. quietly svymean mpg, by(rep)
 
. test [mpg]3=[mpg]4=[mpg]5
 
Adjusted Wald test
 
 ( 1)  [mpg]3 - [mpg]4 = 0
 ( 2)  [mpg]3 - [mpg]5 = 0
 
       F(  2,    57) =    5.12
            Prob > F =    0.0090
 
. quietly xi : svyregress mpg i.rep
 
. test ([#1])
 
Adjusted Wald test
 
 ( 1)  _Irep78_4 = 0
 ( 2)  _Irep78_5 = 0
 
       F(  2,    57) =    5.12
            Prob > F =    0.0090
***** END:

--Jeff
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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