Let's assume optimistically that the wildcard *mm
includes all the variables you want on one side.
You could do this:
foreach m of var *mm {
local f = substr("`m'",1,length("`m'")-1) + "f"
ttest `m' == `f'
}
The first line in the loop could also be
local f = reverse(substr(reverse("`m'"),2,.)) + "f"
but that's a bit of a backwards solution. You might
also consider
local f : subinstr local m "mm" "mf"
but that is more dangerous.
The multiple comparisons issue of firing a shotgun
in this way I leave on one side.
Nick
[email protected]
Kaaresen Per Ivar
>
> However, I now realize I was inaccurate in describing my variable
> names.In fact they are named
>
> dimm atmm comm....... and dimf atmf comf.......
>
> and I want to cycle through
>
> ttest dimm==dimf
> ttest atmm==atmf
>
> and so forth. Sorry for this. Any ideas?
*
* 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/