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

Re: st: doing a t test after svymean


From   austin nichols <[email protected]>
To   [email protected]
Subject   Re: st: doing a t test after svymean
Date   Wed, 28 Dec 2005 09:23:22 -0500

I'm not sure what other question you are referencing, but the easy way
to automate comparing the means of variables for two populations
defined by a dummy variable like male (=1 for males and =0 for
females) is to compare the means using a regression framework (I
assume you are using Stata8, since you refer to svymean):

 foreach v in var1 var2 etc. {
  svyreg `v' male
  test male
  local p_`v'=r(p)
 }

It would not be appropriate to use the above method to compare
proportions, for which you would want something like:

cap gen byte p21=.
cap gen byte p22=.
 foreach v in poor old sick etc {
  svytab `v' male, col
  test p21=p22
  local p_`v'=r(p)
 }

On 12/27/05, Michelle <[email protected]> wrote:
> Hello-
>
> I have a similar question to the one about doing a
> ttest after svymean. I would like to compare my
> cross-sectional and longitudinal variables on key
> variables, and would like to compare the means of the
> two samples, using weights. Although I know that I
> need to use svymean followed by test, I'm not sure
> what the test statement should say. Can you please
> help?
>
> Thank you.
>
>
>
>
> __________________________________
> Yahoo! for Good - Make a difference this year.
> http://brand.yahoo.com/cybergivingweek2005/
> *
> *   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/
>

*
*   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