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/