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)
0 Response to Comparing a variable acorss many categories
Post a Comment