NC STATE University
Department of Statistics

PROBMC function does multiple comparison using means

Example from SAS/STAT Software Changes and Enhancements through Release 6.11, page 933

data duncan;
array tr{7} $;
array mu{7};
n=7;
do i=1 to n;
input tr{i} mu{i}; end;
input df s alpha;
prob=1-alpha;
x=probmc("RANGE", .,prob,df,7);
w=x*s/sqrt(6);

/* compare the means */
do i=1 to n;
do j=i+1 to n;
dmean=abs(mu{i}-mu{j});
if dmean >=w then do;
put tr{i} tr{j} dmean; end; end; end;
drop i j;
cards;
A 49.6
B 71.2
C 67.6
D 61.5
E 71.3
F 58.1
G 61.0
30 8.924 .05 ;

/* sandy's changes */
data duncan;
array tr{7} $;
array mu{7};
n=7;
do i=1 to n;
input tr{i} mu{i}; end;
input df s alpha; prob=1-alpha;
x=probmc("RANGE", .,prob,df,7);
w=x*s/sqrt(6);
/*******************************/
/* compare the means */
/*******************************/
do i=1 to n;
do j=i+1 to n;
sig=' ';
dmean=abs(mu{i}-mu{j});
id1=tr{i};
id2=tr{j};
mean1=mu{i};
mean2=mu{j};
if dmean>w then sig='Yes'; output; end; end;
cards;
A 49.6
B 71.2
C 67.6
D 61.5
E 71.3
F 58.1
G 61.0  30 8.924 .05 ;
proc print;
var i j id1 id2 mean1 mean2 dmean w sig x prob df s;
run;


Go to: SAS Consulting Home Page
           Department of Statistics Home Page

Maintained by: Sandy Donaghy and Joy Smith
Last Modified: July 3, 1997