Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: Testing whether two estimated survey means are statistically different

 From Austin Nichols To statalist@hsphsun2.harvard.edu Subject Re: st: Testing whether two estimated survey means are statistically different Date Thu, 20 Oct 2011 10:39:10 -0400

```Nick--
The poster (Andrew Wade) has survey data, though.
In survey data, using a cluster-robust variance estimator, the two are
identical.

webuse nhanes2, clear
svy: reg bpsystol black, sformat(%7.6f)
qui svy: mean bpsystol, over(black)
lincom _b[1]-_b[0], sformat(%7.6f)

On Thu, Oct 20, 2011 at 10:00 AM, Nick Winter <nwinter@virginia.edu> wrote:
> There is a subtle difference between -svy: reg- and -svy: mean- followed by
> -lincom-.  The former corresponds to a t-test with the assumption that the
> variances in the two populations are equal; the latter corresponds (almost
> exactly) to a t-test without that assumption.  The "almost exactly" is due
> to a difference in calculation of degrees of freedom.
>
> Leaving aside -svy-, we can see the slightly different standard errors:
>
> sysuse auto
> reg mpg foreign
> ttest mpg, over(foreign)
>
> mean: mpg, over(foreign)
> lincom _b[Domestic]-_b[Foreign]
> ttest mpg, over(foreign) unequal
>
>
> - Nick Winter
>
> On 10/20/2011 4:58 AM, Maarten Buis wrote:
>>
>> On Wed, Oct 19, 2011 at 11:33 PM, Andrew Wade<awade@allenconsult.com.au>
>>  wrote:
>>>
>>> Presumably the regression approach, where you have a single dummy for the
>>> sub-population, will be identical (or near identical) to:
>>> - estimating svy: mean with over command (ie. mean for sub-population,
>>> and not in sub-population).
>>> - lincom after svy: mean.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```