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

Re: st: Numerous t-tests


From   Ronán Conroy <rconroy@rcsi.ie>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Numerous t-tests
Date   Wed, 26 Oct 2005 15:51:46 +0100

On 26 DFómh 2005, at 11:32, Allan Garland wrote:

I have what should be a very simple question, but I haven't been able to
figure out the answer. I want to do group mean comparison t-tests and
rank sum tests on a number of different variables.. But, it appears
that both -ttest- and -ranksum- will only do 1 variable at a time. So,
is there a single command that will let me put in any number of
variables (along with the 2-level grouping variable, of course) and will
then do ALL the tests at once?

-regress- is a lot faster than t-test, and the output is easier to read, IMO. The coefficient and its confidence interval represent the difference in means and its CI.

for slamming through variable lists, I still like -for-

. for var1 - var99 : regress X gender \ ranksum X, by(gender)

Note that this gives you your OLS and rank test one under the other.

Another advantage of regress is that you can adjust the comparisons:

. for var1 - var99 : regress X gender age \ adjust, by(gender) xb ci format(your format here)

and this little tweak would dump age-adjusted means and confidence intervals into the output in the right place.


Ronán Conroy
rconroy@rcsi.ie




*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index