# Re: st: stumped with lincom after svymean

 From jpitblado@stata.com (Jeff Pitblado, StataCorp LP) To statalist@hsphsun2.harvard.edu Subject Re: st: stumped with lincom after svymean Date Tue, 31 Aug 2004 16:42:25 -0500

```Hong <hk489@nyu.edu> 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

( 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])

( 1)  _Irep78_4 = 0
( 2)  _Irep78_5 = 0

F(  2,    57) =    5.12
Prob > F =    0.0090
***** END:

--Jeff
*
*   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/
```