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
[email protected]
*
* 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/