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

RE: st: ttest var1==var2 for clustered data

From   Nick Winter <[email protected]>
To   [email protected]
Subject   RE: st: ttest var1==var2 for clustered data
Date   Tue, 22 Mar 2005 09:47:22 -0500

How about

  . generate diff = var1-var2
  . svymean diff
  . text diff=0


--Nick Winter

At 02:28 PM 3/22/2005 +0000, you wrote:
> The problem is, we want to perform a mean comparison between
> two variables
> (paired t-test) and not between two subgroups. The syntax
> without adjusting
> for the clustering is  "ttest var1=var2", thus using inflated
> degrees of
> freedom, 'cause no adjustment for the clustering of the data
> is possible.
> In contrast performing the test with a disaggregated file
> would result in
> deflated degrees of freedom...
> For our group comparisons we exactly use your proposition.

Rich Goldstein

> >a t-test is a simple regression where the only predictor is the dummy
> >variable identifying the groups -- so, put the two variables
> into one long
> >variable; add a group identifier and use regression with the
> cluster option

Christian Hunkler
Nicholas Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government [email protected] e
308 White Hall w
Cornell University
Ithaca, NY 14853-4601

* For searches and help try:

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