* WLoss2 Example -- source code file wloss2.sas; options linesize=70 nodate; data wloss; input center $ @; do i = 1 to 10; input loss @; output; end; drop i; label center = 'Weight Loss Center' loss = 'Amount of Weight Loss'; datalines; A 12.4 10.7 11.9 11.0 12.4 12.3 13.0 12.5 11.2 13.1 B 9.1 11.5 11.3 9.7 13.2 10.7 10.6 11.3 11.1 11.7 C 8.5 11.6 10.2 10.9 9.0 9.6 9.9 11.3 10.5 11.2 D 8.7 9.3 8.2 8.3 9.0 9.4 9.2 12.2 8.5 9.9 E 12.7 13.2 11.8 11.9 12.2 11.2 13.7 11.8 11.5 11.7 ; proc print; proc anova; class center; model loss=center; * Perform post hoc comparisons to see which groups differ from which other groups using the Bonferroni test, which is the most conservative test available; means center / bon; data with_dummy; set wloss; * The = in (center = 'A') is a boolean operator that returns 1 if the expression is true and 0 otherwise; dummy_a = (center = 'A'); dummy_b = (center = 'B'); dummy_c = (center = 'C'); dummy_e = (center = 'E'); keep dummy_a dummy_b dummy_c dummy_e loss; label dummy_a = 'Weight Loss Center A' dummy_b = 'Weight Loss Center B' dummy_c = 'Weight Loss Center C' dummy_e = 'Weight Loss Center E' loss = 'Amount of Weight Loss'; proc print; * The intercept parameter is the predicted amount of weight loss at Center D. Each of the dummy variable parameters is the additional predicted loss at the other centers; proc reg data=with_dummy; model loss = dummy_a dummy_b dummy_c dummy_e; plot r.*p. r.*nqq.; run; quit;