Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Several ttests


From   Fred Wolfe <[email protected]>
To   [email protected]
Subject   Re: st: Several ttests
Date   Thu, 28 Dec 2006 15:37:44 -0600

You have to use the foreach command, something like this:

foreach var of varlist varname* {
di "`var'"
ttest `var', by(whatever)
}

It would be nice if Stata would build this into the -ttest- command.

Fred Wolfe


At 03:30 PM 12/28/2006, Claude Francoeur wrote:
Hello,

I am comparing means for several variables (varname2 to varname10):

ttest varname2, by(varname1)

ttest varname3, by(varname1)

etc.

Is there a command or do file to do all these comparisons at once and
perhaps generate a summary of the results in a table?

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

Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel +1 316 263 2125
[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/



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