Dear statalisters,
Here is my problem for which I need your help. (I'm using STATA8.0)
Simplified form of the data look like...
id group var1 var2 var3 var4 .........
1 a 1 . 3
2 a 3 . 2
3 b 1 2 4
4 b 2 1 5
I would like to do the mean-difference test for each variables by group.
So I make the do file containing
local i = 1
while `i' <= 3 {
ttest var`i', by(group)
local i = `i' + 1
}
Then, ttest for var1 is ok, but with var2 STATA makes error "r(420) 1group found, 2 required" (because of data missing) and stops without ttesting for var3.
Is there any way that I can get the result of ttest for var1 and var3 without being stopped at var2?
PS. I need to have the ttest results for var1 and var3, so I cannot use "capture" command.
Many thanks in advance.
*
* 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/