I want to test that a variable does not differ by group. I get how to do it between two groups but not more than two unless I do it inefficiently. I created a fake example and how I am currently doing it. Is it possible to do this more directly?

Code:
clear all
set obs 100
gen grp = ""
replace grp = "A" if _n <= 25
replace grp = "B" if _n > 25 & _n <= 50
replace grp = "C" if _n > 50 & _n <= 75
replace grp = "D" if _n > 75 & _n <= 100
gen rand = 1 + rnormal()

ttest rand if grp == "A" | grp == "B", by(grp)
ttest rand if grp == "A" | grp == "C", by(grp)
ttest rand if grp == "A" | grp == "D", by(grp)
ttest rand if grp == "B" | grp == "C", by(grp)
ttest rand if grp == "B" | grp == "D", by(grp)
ttest rand if grp == "C" | grp == "D", by(grp)