PROBMC Function

Returns a probability or a quantile from various distributions for multiple comparisons of means.

Category:Probability

Syntax

Required Arguments

distribution

is a character constant, variable, or expression that identifies the distribution.

The following distributions are valid:

Distribution

Argument

Analysis of Means

ANOM

One-sided Dunnett

DUNNETT1

Two-sided Dunnett

DUNNETT2

Maximum Modulus

MAXMOD

Partitioned Range

PARTRANGE

Studentized Range

RANGE

Williams

WILLIAMS

q

is a numeric constant, variable, or expression that specifies the quantile from the distribution.

RestrictionEither q or prob can be specified, but not both.

prob

is a numeric constant, variable, or expression that specifies the left probability from the distribution.

RestrictionEither prob or q can be specified, but not both.

df

is a numeric constant, variable, or expression that specifies the degrees of freedom.

Note: A missing value is interpreted as an infinite value.

nparms

is a numeric constant, variable, or expression that specifies the number of treatments.

Note: For DUNNETT1 and DUNNETT2, the control group is not counted.

Optional Argument

parameters

is an optional set of nparms parameters that must be specified to handle unequal sample sizes. The meaning of parameters depends on the value of distribution. If parameters is not specified, equal sample sizes are assumed, which is usually the case for a null hypothesis.

Details

Overview

The PROBMC function returns the probability or the quantile from various distributions with finite and infinite degrees of freedom for the variance estimate.

The prob argument is the probability that the random variable is less than q. Therefore, p-values can be computed as 1– prob. For example, to compute the critical value for a 5% significance level, set prob= 0.95.

The precision of the computed probability is O(10—8) (absolute error); the precision of the computed quantile is O(10—5).

Note: The studentized range is not computed for finite degrees of freedom and unequal sample sizes.
Note: Williams' test is computed only for equal sample sizes.

Formulas and Parameters

The equations listed here define expressions that are used in equations that relate the probability, prob, and the quantile, q, for different distributions and different situations within each distribution. For these equations, let v be the degrees of freedom, df.

table with 1 row and 1 column , row1 column 1 , d , mu sub nu . open x close , equals . fraction nu super nu over 2 end super , over cap gamma . open , nu over 2 , close . 2 super nu over 2 , minus 1 end super end fraction . x super nu minus 1 end super . epsilon super negative . fraction nu , x squared , over 2 end fraction end super . d x , end table. Click image for alternative formats.
table with 1 row and 1 column , row1 column 1 , straight phi , open x close , equals , fraction 1 , over square root of 2 pi end root end fraction . epsilon super negative , fraction x squared , over 2 end fraction end super , end table. Click image for alternative formats.
table with 1 row and 1 column , row1 column 1 , cap phi , open x close , equals . integral , from , negative infinity , to , x , of . straight phi , open u close , d u , end table. Click image for alternative formats.

Computing the Analysis of Means

Analysis of Means (ANOM) applies to data that is organized as k (Gaussian) samples; the ith sample is size ni. Let i equals , square root of negative 1 end root. Click image for alternative formats. . The distribution function [1, 2, 3, 4, 5] is the CDF for the maximum absolute of a k-dimensional multivariate graphic vector, with nu. Click image for alternative formats. degrees of freedom, and an associated correlation matrix rho sub i j end sub , equals negative , alpha sub i , alpha sub j. Click image for alternative formats.. This equation can be written as

table with 2 rows and 2 columns , row1 column 1 , p r o b , column 2 equals r . open absolute value of , t sub 1 , end absolute value , . less than h comma absolute value of , t sub 2 , end absolute value , . less than h comma . . . comma absolute value of , t sub k , end absolute value , . less than h close , row2 column 1 , , column 2 equals , integral , from , 0 , to , infinity , of . left brace , integral , from , 0 , to , infinity , of , . product , from , j equals 0 , to , j equals k , of . g . open s h comma y comma , alpha sub j , close . straight phi , open y close , d y right brace . d , mu sub nu . open s close , end table. Click image for alternative formats.

The following relationship applies to the preceding equation:

table with 1 row and 1 column , row1 column 1 , g . open s h comma y comma , alpha sub j , close . equals cap phi . open . fraction s h minus y , alpha sub j , over square root of 1 plus , alpha sub j and super 2 end root end fraction . close . minus cap phi . open . fraction negative s h minus y , alpha sub j , over square root of 1 plus , alpha sub j and super 2 end root end fraction . close , end table. Click image for alternative formats.

cap gamma , open . close. Click image for alternative formats., straight phi , open . close. Click image for alternative formats., and cap phi , open . close. Click image for alternative formats., are the gamma function, the density, and the CDF from the standard normal distribution, respectively.

For nu equals infinity. Click image for alternative formats., the distribution reduces to:

table with 1 row and 1 column , row1 column 1 , r . open absolute value of , t sub 1 , end absolute value , . less than h comma absolute value of , t sub 2 , end absolute value , . less than h comma . . . comma absolute value of , t sub k , end absolute value , . less than h close . equals , integral , from , 0 , to , infinity , of . product , from , j equals 0 , to , j equals k , of . g . open h comma y comma , alpha sub j , close . straight phi , open y close , d y , end table. Click image for alternative formats.

The following relationship applies to the preceding equation:

table with 1 row and 1 column , row1 column 1 , g . open h comma y comma , alpha sub j , close . equals cap phi . open . fraction h minus y , alpha sub j , over square root of 1 plus , alpha sub j and super 2 end root end fraction . close . minus cap phi . open . fraction negative h minus y , alpha sub j , over square root of 1 plus , alpha sub j and super 2 end root end fraction . close , end table. Click image for alternative formats.

For the balanced case, the distribution reduces to the following:

table with 1 row and 1 column , row1 column 1 , r . open absolute value of , t sub 1 , end absolute value , . less than h comma absolute value of , t sub 2 , end absolute value , . less than h comma . . . comma absolute value of , t sub n , end absolute value , . less than h close . equals , integral , from , 0 , to , infinity , of , f . open h comma y comma rho close to the n . straight phi , open y close , d y , end table. Click image for alternative formats.

The following relationship applies to the preceding equation:

table with 1 row and 1 column , row1 column 1 , f . open h comma y comma rho close . equals cap phi . open . fraction h minus y square root of rho , over square root of 1 plus rho end root end fraction . close . minus cap phi . open . fraction negative h minus y square root of rho , over square root of 1 plus rho end root end fraction . close , end table. Click image for alternative formats.

and rho equals . fraction 1 , over n minus 1 end fraction. Click image for alternative formats.

Here is the syntax for this distribution:

x=probmc('anom', q, p, nu, n, <alpha1 , ..., alphan>);

Arguments

x

is a numeric value with the returned result.

q

is a numeric value that denotes the quantile.

p

is a numeric value that denotes the probability. One of p and q must be missing.

nu

is a numeric value that denotes the degrees of freedom.

n

is a numeric value that denotes the number of samples.

alphai, i=1, ..., k

are optional numeric values that denote the alpha values from the first equation of this distribution. See Computing the Analysis of Means.

Many-One t-Statistics: Dunnett's One-Sided Test

  • This case relates the probability, prob, and the quantile, q, for the unequal case with finite degrees of freedom. The parameters are λ1, ..., λk, the value of nparms is set to k, and the value of df is set to ν.
    table with 1 row and 1 column , row1 column 1 , p r o b equals , integral , from , 0 , to , infinity , of . integral , from , negative infinity , to , infinity , of . straight phi , open y close . product , from , i equals 1 , to , k , of . cap phi . open . fraction lamda sub i , y plus q x , over square root of 1 minus , lamda sub i and super 2 end root end fraction . close . d y d , u sub nu . open x close , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the equal case with finite degrees of freedom. No parameters are passed open lamda equals , square root of 1 half end root , close. Click image for alternative formats., the value of nparms is set to k, and the value of df is set to ν.
    table with 1 row and 1 column , row1 column 1 , p r o b equals , integral , from , 0 , to , infinity , of . integral , from , negative infinity , to , infinity , of . straight phi , open y close . left bracket cap phi . open y plus , square root of 2 q x end root , close . right bracket to the k . d y d , u sub nu . open x close , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the unequal case with infinite degrees of freedom. The parameters are λ1, ..., λk, the value of nparms is set to k, and the value of df is set to missing.
    table with 1 row and 1 column , row1 column 1 , p r o b equals . integral , from , negative infinity , to , infinity , of . straight phi , open y close . product , from , i equals 1 , to , k , of . cap phi . open . fraction lamda sub i , y plus q , over square root of 1 minus , lamda sub i and super 2 end root end fraction . close . d y , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the equal case with infinite degrees of freedom. No parameters are passed open lamda equals , square root of 1 half end root , close. Click image for alternative formats., the value of nparms is set to k, and the value of df is set to missing.
    table with 1 row and 1 column , row1 column 1 , p r o b equals . integral , from , negative infinity , to , infinity , of . straight phi , open y close . left bracket cap phi . open y plus , square root of 2 q end root , close . right bracket to the k . d y , end table. Click image for alternative formats.

Many-One t-Statistics: Dunnett's Two-Sided Test

  • This case relates the probability, prob, and the quantile, q, for the unequal case with finite degrees of freedom. The parameters are λ1, ..., λk, the value of nparms is set to k, and the value of df is set to ν.
    table with 1 row and 1 column , row1 column 1 , p r o b equals , integral , from , 0 , to , infinity , of . integral , from , negative infinity , to , infinity , of . straight phi , open y close . product , from , i equals 1 , to , k , of . left bracket cap phi . open . fraction lamda sub i , y plus q x , over square root of 1 minus , lamda sub i and super 2 end root end fraction . close . minus cap phi . open . fraction lamda sub i , y minus q x , over square root of 1 minus , lamda sub i and super 2 end root end fraction . close . right bracket . d y d , u sub nu . open x close , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the equal case with finite degrees of freedom. No parameters are passed, the value of nparms is set to k, and the value of df is set to ν.
    table with 1 row and 1 column , row1 column 1 , p r o b equals , integral , from , 0 , to , infinity , of . integral , from , negative infinity , to , infinity , of . straight phi , open y close . left bracket cap phi . open y plus , square root of 2 q x end root , close . minus cap phi . open y minus , square root of 2 q x end root , close . right bracket to the k . d y d , u sub nu . open x close , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the unequal case with infinite degrees of freedom. The parameters are λ1, ..., λk, the value of nparms is set to k, and the value of df is set to missing.
    table with 1 row and 1 column , row1 column 1 , p r o b equals . integral , from , negative infinity , to , infinity , of . straight phi , open y close . product , from , i equals 1 , to , k , of . left bracket cap phi . open . fraction lamda sub i , y plus q , over square root of 1 minus , lamda sub i and super 2 end root end fraction . close . minus cap phi . open . fraction lamda sub i , y minus q , over square root of 1 minus , lamda sub i and super 2 end root end fraction . close . right bracket . d y , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the equal case with infinite degrees of freedom. No parameters are passed, the value of nparms is set to k, and the value of df is set to missing.
    table with 1 row and 1 column , row1 column 1 , p r o b equals . integral , from , negative infinity , to , infinity , of . straight phi , open y close . left bracket cap phi . open y plus , square root of 2 q end root , close . minus cap phi . open y minus , square root of 2 q end root , close . right bracket to the k . d y , end table. Click image for alternative formats.

Computing the Partitioned Range

RANGE applies to the distribution of the studentized range for n group means. PARTRANGE applies to the distribution of the partitioned studentized range. Let the n groups be partitioned into k subsets of size n1+ ...+ nk= n. Then the partitioned range is the maximum of the studentized ranges in the respective subsets. The studentization factor is the same in all cases.

table with 1 row and 1 column , row1 column 1 , p r o b equals , integral , from , 0 , to , infinity , of . product , from , i equals 1 , to , i equals k , of . open . integral , from , negative infinity , to , infinity , of . k straight phi , open y close . open cap phi , open y close , minus cap phi . open y minus q x close . close super k minus 1 end super . d y close super n sub i end super . d , mu sub nu . open x close , end table. Click image for alternative formats.

Here is the syntax for this distribution:

x=probmc('partrange', q, p, nu, k, n1, ..., nk);

Arguments

x

is a numeric value with the returned result (either the probability or the quantile).

q

is a numeric value that denotes the quantile.

p

is a numeric value that denotes the probability. One of p and q must be missing.

nu

is a numeric value that denotes the degrees of freedom.

k

is a numeric value that denotes the number of groups.

ni i=1, ..., k

are optional numeric values that denote the n values from the equation in this distribution.See Computing the Partitioned Range.

The Studentized Range

Note: The studentized range is not computed for finite degrees of freedom and unequal sample sizes.
  • This case relates the probability, prob, and the quantile, q, for the equal case with finite degrees of freedom. No parameters are passed, the value of nparms is set to k, and the value of df is set to ν.
    table with 1 row and 1 column , row1 column 1 , p r o b equals , integral , from , 0 , to , infinity , of . integral , from , negative infinity , to , infinity , of . k straight phi , open y close . left bracket cap phi , open y close , minus cap phi . open y minus q x close . right bracket super k minus 1 end super . d y d , u sub nu . open x close , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the unequal case with infinite degrees of freedom. The parameters are σ1, ..., σk, the value of nparms is set to k, and the value of df is set to missing.
    table with 1 row and 1 column , row1 column 1 , p r o b equals . integral , from , negative infinity , to , infinity , of . modified cap sigma with j equals 1 below and with k above the set . product , from , i equals 1 , to , k , of . left bracket cap phi . open , fraction y , over sigma sub i end fraction , close . minus cap phi . open . fraction y minus q , over sigma sub i end fraction . close . right bracket end set . straight phi . open , fraction y , over sigma sub j end fraction , close . fraction 1 , over sigma sub j end fraction , d y , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the equal case with infinite degrees of freedom. No parameters are passed, the value of nparms is set to k, and the value of df is set to missing.
    table with 1 row and 1 column , row1 column 1 , p r o b equals . integral , from , negative infinity , to , infinity , of . k straight phi , open y close . left bracket cap phi , open y close , minus cap phi . open y minus q close . right bracket super k minus 1 end super . d y , end table. Click image for alternative formats.

The Studentized Maximum Modulus

  • This case relates the probability, prob, and the quantile, q, for the unequal case with finite degrees of freedom. The parameters are σ1, ..., σk, the value of nparms is set to k, and the value of df is set to ν.
    table with 1 row and 1 column , row1 column 1 , p r o b equals , integral , from , 0 , to , infinity , of . product , from , i equals 1 , to , k , of . left bracket 2 cap phi . open . fraction q x , over sigma sub i end fraction . close . minus 1 right bracket . d , mu sub nu . open x close , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the equal case with finite degrees of freedom. No parameters are passed, the value of nparms is set to k, and the value of df is set to ν.
    table with 1 row and 1 column , row1 column 1 , p r o b equals , integral , from , 0 , to , infinity , of . left bracket 2 cap phi , open q x close , minus 1 right bracket to the k . d , mu sub nu . open x close , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the unequal case with infinite degrees of freedom. The parameters are σ1, ..., σk, the value of nparms is set to k, and the value of df is set to missing.
    table with 1 row and 1 column , row1 column 1 , p r o b equals . product , from , i equals 1 , to , k , of . left bracket 2 cap phi . open , fraction q , over sigma sub i end fraction , close . minus 1 right bracket , end table. Click image for alternative formats.
  • This case relates the probability, prob, and the quantile, q, for the equal case with infinite degrees of freedom. No parameters are passed, the value of nparms is set to k, and the value of df is set to missing.
    table with 1 row and 1 column , row1 column 1 , p r o b equals . left bracket 2 cap phi , open q close , minus 1 right bracket to the k , end table. Click image for alternative formats.

Williams' Test

PROBMC computes the probabilities or quantiles from the distribution defined in Williams (1971, 1972). (See “References” .) It arises when you compare the dose treatment means with a control mean to determine the lowest effective dose of treatment.

Note: Williams' Test is computed only for equal sample sizes.

Let X1, X2, ..., Xk be identical independent N(0,1) random variables. Let Yk denote their average given by this equation

table with 1 row and 1 column , row1 column 1 , y sub k , equals . fraction x sub 1 , plus , x sub 2 , plus . . . plus , x sub k , over k end fraction , end table. Click image for alternative formats.

It is required to compute the distribution of this equation

table with 1 row and 1 column , row1 column 1 , open , y sub k , minus z close . slash s , end table. Click image for alternative formats.

Arguments

Yk

is as defined previously.

Z

is an N(0,1) independent random variable.

S

is such that ½νS2 is a χ2 variable with ν degrees of freedom.

As described in Williams (1971) (see “References” ), the full computation is extremely lengthy and is carried out in three stages.

  1. Compute the distribution of Yk. It is the fundamental (expensive) part of this operation and it can be used to find both the density and the probability of Yk. Let Ui be defined as
    table with 1 row and 1 column , row1 column 1 , u sub i , equals . fraction x sub 1 , plus , x sub 2 , plus . . . plus , x sub i , over i end fraction . comma i equals 1 comma 2 comma . . . comma k , end table. Click image for alternative formats.

    You can write a recursive expression for the probability of Yk > d, with d as any real number.

    table with 6 rows and 2 columns , row1 column 1 , cap pr of . open , y sub k , greater than d close , column 2 equals cap pr of . open , u sub 1 , greater than d close , row2 column 1 , , column 2 plus cap pr of . open , u sub 2 , greater than d comma , u sub 1 , less than d close , row3 column 1 , , column 2 plus cap pr of . open , u sub 3 , greater than d comma , u sub 2 , less than d comma , u sub 1 , less than d close , row4 column 1 , , column 2 plus dot dot dot , row5 column 1 , , column 2 plus cap pr of . open , u sub k , greater than d comma . u sub k minus 1 end sub . less than d comma dot dot dot comma , u sub 1 , less than d close , row6 column 1 , , column 2 equals cap pr of . open . y sub k minus 1 end sub . greater than d close . plus cap pr of . open , x sub k , plus . open k minus 1 close . u sub k minus 1 end sub . greater than k d close , end table. Click image for alternative formats.

    To compute this probability, start from an N(0,1) density function

    table with 1 row and 1 column , row1 column 1 , d . open , u sub 1 , equals x close . equals straight phi , open x close , end table. Click image for alternative formats.

    and recursively compute the convolution

    table with 2 rows and 1 column , row1 column 1 , d . open , u sub k , equals x comma . u sub k minus 1 end sub . less than d comma dot dot dot comma , u sub 1 , less than d close . equals , row2 column 1 , integral , from , negative infinity , to , d , of d . open . u sub k minus 1 end sub . equals y comma . u sub k minus 2 end sub . less than d comma dot dot dot comma , u sub 1 , less than d close . open k minus 1 close . straight phi . open k x minus . open k minus 1 close . y close . d y , end table. Click image for alternative formats.

    From this sequential convolution, it is possible to compute all the elements of the recursive equation for cap pr of . open , y sub k , less than d close. Click image for alternative formats., shown previously.

  2. Compute the distribution of Yk – Z. This computation involves another convolution to compute the probability
    table with 1 row and 1 column , row1 column 1 , cap pr of . open . open , y sub k , minus z close . greater than d close . equals . integral , from , negative infinity , to , infinity , of . cap pr of . open , y sub k , greater than , square root of 2 d end root , plus y close . straight phi , open y close , d y , end table. Click image for alternative formats.
  3. Compute the distribution of (Yk – Z)/S. This computation involves another convolution to compute the probability
    table with 1 row and 1 column , row1 column 1 , cap pr of . open . open , y sub k , minus z close . greater than t s close . equals , integral , from , 0 , to , infinity , of , cap pr of . open . open , y sub k , minus z close . greater than t y close . d , mu sub nu . open y close , end table. Click image for alternative formats.

The third stage is not needed when ν = ∞. Due to the complexity of the operations, this lengthy algorithm is replaced by a much faster one when k ≤ 15 for both finite and infinite degrees of freedom ν. For k ≥ 16, the lengthy computation is carried out. It is extremely expensive and very slow due to the complexity of the algorithm.

Comparisons

The MEANS statement in the GLM Procedure of SAS/STAT Software computes the following tests:

  • Dunnett's one-sided test
  • Dunnett's two-sided test
  • Studentized Range

Examples

Example 1: Computing Probabilities By Using PROBMC

This example shows how to compute probabilities.

data probs;
   array par{5};
      par{1}=.5;
      par{2}=.51;
      par{3}=.55;
      par{4}=.45;
      par{5}=.2;
   df=40;
   q=1;
   do test="dunnett1","dunnett2", "maxmod";
      prob=probmc(test, q, ., df, 5, of par1–par5);
      put test $10. df q e18.13 prob e18.13;
   end;
run; 

These statements produce these results:

DUNNETT1  40  1.00000000000E+00 4.82992196083E-01
DUNNETT2  40  1.00000000000E+00 1.64023105316E-01
MAXMOD    40  1.00000000000E+00 8.02784203408E-01

Example 2: Computing the Analysis of Means

data _null_;
   q1=probmc('anom', ., 0.9, ., 20);                           put q1=;
   q2=probmc('anom', ., 0.9, 20, 5, 0.1, 0.1, 0.1, 0.1, 0.1);  put q2=;
   q3=probmc('anom', ., 0.9, 20, 5, 0.5, 0.5, 0.5, 0.5, 0.5);  put q3=;
   q4=probmc('anom', ., 0.9, 20, 5, 0.1, 0.2, 0.3, 0.4, 0.5);  put q4=;
run;

These statements produce these results:

q1=2.7895061016
q2=2.4549961967
q3=2.4549961967
q4=2.4532319994

Example 3: Comparing Means

This example shows how to compare group means to find where the significant differences lie. The data for this example is taken from a paper by Duncan (1955), and can also be found in Hochberg and Tamhane (1987). (See the References section at the end of this function.)

The following values are the group means:

  • 49.6
  • 71.2
  • 67.6
  • 61.5
  • 71.3
  • 58.1
  • 61.0

For this data, the mean square error is s2=79.64 (s=8.924) with ν = 30.

data duncan;
   array tr{7}$;
   array mu{7};
   n=7;
   do i=1 to n;
      input tr{i} $1. mu{i};
   end;
   input df s alpha;
   prob=1-alpha;
      /* compute the interval */
   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;
   datalines;
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
;
run;

These statements produce these results:

A B 21.6
A C 18
A E 21.7

Example 4

data _null_;
   q1=probmc('partrange', ., 0.9, ., 4, 3, 4, 5, 6);  put q1=;
   q2=probmc('partrange', ., 0.9, 12, 4, 3, 4, 5, 6); put q2=;
run;

These statements produce these results:

q1=4.1022397989
q2=4.7888626338

Example 5: Computing Confidence Intervals

This example shows how to compute 95% one-sided and two-sided confidence intervals of Dunnett's test. This example and the data come from Dunnett (1955), and can also be found in Hochberg and Tamhane (1987). (See the References section at the end of this function.) The data are blood count measurements on three groups of animals. As shown in the following table, the third group serves as the control, and the first two groups were treated with different drugs. The numbers of animals in these three groups are unequal.

Treatment Group:

Drug A

Drug B

Control

9.76

12.80

7.40

8.80

9.68

8.50

7.68

12.16

7.20

9.36

9.20

8.24

10.55

9.84

8.32

Group Mean

8.90

10.88

8.25

n

4

5

6

The mean square error s2=1.3805 (s=1.175) with ν = 12.

data a;
   array drug{3}$;
   array count{3};
   array mu{3};
   array lambda{2};
   array delta{2};
   array left{2};
   array right{2};
      /* input the table */
   do i=1 to 3;
      input drug{i} count{i} mu{i};
   end;
      /* input the alpha level,    */
      /* the degrees of freedom,   */
      /* and the mean square error */
   input alpha df s;
   
      /* from the sample size, */
      /* compute the lambdas   */
   do i=1 to 2;
      lambda{i}=sqrt(count{i}/
        (count{i} + count{3}));
   end;
      /* run the one-sided Dunnett's test */
   test="dunnett1";
      x=probmc(test, ., 1 - alpha, df, 
                 2, of lambda1-lambda2);
      do i=1 to 2;
         delta{i}=x * s * 
            sqrt(1/count{i} + 1/count{3});
         left{i}=mu{i} - mu{3} - delta{i};
      end;
   put test $10. x left{1} left{2};
      /* run the two-sided Dunnett's test */
   test="dunnett2";
      x=probmc(test, ., 1 - alpha, df, 
                 2, of lambda1-lambda2);
      do i=1 to 2;
         delta{i}=x * s * 
            sqrt(1/count{i} + 1/count{3});
         left{i}=mu{i} - mu{3} - delta{i};
         right{i}=mu{i} - mu{3} + delta{i};
      end;
   put test $10. left{1} right{1};
   put test $10. left{2} right{2};
   datalines;
A 4 8.90
B 5 10.88
C 6 8.25
0.05 12 1.175
;
run;

These statements produce these results:

DUNNETT1  2.1210448226 -0.958726041 1.1208812046
DUNNETT2  -1.256408109 2.5564081095
DUNNETT2  0.8416306717 4.4183693283

Example 6: Computing Williams' Test

In the following example, a substance has been tested at seven levels in a randomized block design of eight blocks. The observed treatment means are as follows:

Treatment

Mean

X0

10.4

X1

9.9

X2

10.0

X3

10.6

X4

11.4

X5

11.9

X6

11.7

The mean square, with (7 – 1)(8 – 1)=42 degrees of freedom, is s2=1.16.

Determine the maximum likelihood estimates Mi through the averaging process.

  • Because X0 > X1, form X0,1=(X0 + X1)/2=10.15.
  • Because X0,1 > X2, form X0,1,2=(X0 + X1 + X2)/3=(2X0,1 + X2)/3=10.1.
  • X0,1,2 < X3 < X4 < X5
  • Because X5 > X6, form X5,6=(X5 + X6)/2=11.8.

Now the order restriction is satisfied.

Here are the maximum likelihood estimates under the alternative hypothesis:

  • M0=M1=M2 = X0,1,2=10.1
  • M3=X3=10.6
  • M4=X4=11.4
  • M5=M6=X5,6=11.8

Now compute t equals . open 1 1 . 8 minus 1 0 . 4 close . slash . square root of 2 , s squared , slash 8 end root . equals 2 . 6 0. Click image for alternative formats., and the probability that corresponds to k= 6, ν = 42, and t= 2.60 is .9924467341, which shows strong evidence that there is a response to the substance. You can also compute the quantiles for the upper 5% and 1% tails, as shown in the following table.

data one;                                                                                                                               
   prob=probmc("williams", 2.6, ., 42, 6);                                                                                                
   quant5=probmc("williams", ., .95, 42, 6);                                                                                              
   quant1=probmc("williams", ., .99, 42, 6);                                                                                              
   put prob=;
   put quant5=;
   put quant1=;                                                                                                             
run; 

These statements produce these results:

prob=0.9924466872
quant5=1.806562536
quant1=2.490908273

See Also

References

Guirguis, G. H., and R. D. Tobias. “On the Computation of the Distribution for the Analysis of Means.” 2004. Communications in Statistics: Simulation and Computation 33: 861–887.

Nelson, P. R. “Numerical Evaluation of an Equi-correlated Multivariate Non-central t Distribution.” 1981. Communications in Statistics: Part B - Simulation and Computation 10: 41–50.

Nelson, P. R. “Exact Critical Points for the Analysis of Means.” 1982. Communications in Statistics: Part A - Theory and Methods 11: 699–709.

Nelson, P. R. “An Approximation for the Complex Normal Probability Integral.” 1982a. BIT 22(1): 94–100.

Nelson, P. R. “Application of the Analysis of Means.” 1988. Proceedings of the SAS Global Forum Conference 13: 225–230.

Nelson, P. R. “Numerical Evaluation of Multivariate Normal Integrals with Correlations.” 1991. The Frontiers of Statistical Scientific Theory and Industrial Applications 2: 97–114.

Nelson, P. R. “Additional Uses for the Analysis of Means and Extended Tables of Critical Values.” 1993. Technometrics 35: 61–71.

Last updated: April 14, 2026