*! version 2.0.0 17jul2024
help pwmc

Title

pwmc -- Pairwise multiple comparisons of means with
unequal variances

Syntax

Pairwise multiple comparisons of means

pwmc
varname
[if] [in]
, over(varname)
[
options
]

Immediate form

pwmci
(#obs1 #mean1 #sd1)
(#obs2 #mean2 #sd2)
(#obs3 #mean3 #sd3)
...
[
,
options
]

Main
* over(varname) compare means over the levels
of varname

Reporting
mcompare(method) adjust
for multiple comparisons; default is mcompare(c gh t2)

hc3 estimate HC3 standard errors; see regress

welch use Welch's approximate degrees of freedom

level(#) set confidence level; default is
level()

cieffects display confidence intervals; the default

pveffects display test statistics and p-values

effects display test statistics, p-values, and
confidence intervals

varlabel display variable labels

vallabel display value labels

format_options control column formats

notable suppress coefficient table

* over(varname) is not allowed with the
immediate command and required otherwise.

Description

pwmc
performs pairwise comparisons of means.
It computes pairwise differences of the means of varname
over the levels of over(varname).
The standard errors and confidence intervals
do not assume equal variances across groups.
pwmc
adjusts the p-values and confidence intervals for multiple comparisons.

pwmci
is the immediate form of pwmc; see immed.

Options

Main

over(varname)
is required with pwmc
and it specifies that means are computed for each level of varname.
The option is not allowed with pwmci.

Reporting

mcompare(method)
specifies the method for computing p-values and confidence intervals.
Confidence intervals are computed as

CI = d +/- A*se

where d is the difference between means, se is the standard error of
the difference, and A is the critical value adjusted according to
method.

mcompare(noadjust) specifies no adjustment for multiple
comparisons.

A = inv_t

where inv_t is the inverse cumulative (upper tail)
Student's t distribution with nuhat degrees
of freedom using Satterthwaite's (1946) approximation formula,
and alpha = /100 (see option level()).

The unadjusted p-value is

p = 2 * ttail

where ttail is the cumulative (upper tail)
Student's t distribution and |t| is the
(absolute) t value.

noadjust is a synonym for mcompare(noadjust).

mcompare(c) implements Dunnett's (1980) C method.

A = inv_SR_star^(1/2)

where inv_SR_star is computed as follows. Let i = 1, 2, ..., k denote
the k groups. Let n_i denote the number of observations in group i and
v_i the squared standard error of the mean in group i. Further, let
inv_SR_i denote the inverse
Studentized range distribution with k, n_i, and
alpha defined as above. Then,

inv_SR_star = (inv_SR_i*v_i + inv_SR_j*v_j) / (v_i + v_j)

pwmc does not compute adjusted p-values for Dunnett's C method.

mcompare(gh) implements the method discussed in
Games and Howell (1976).

A = inv_SR^(1/2)

where inv_SR is the inverse Studentized range distribution and all other
terms are defined as above.

The adjusted p-value is computed as

p_adj = 1 - SR

where SR is the cumulative Studentized range distribution
and all other terms are defined as above.

mcompare(t2) implements Tamhane's (1979) T2 method.

A = inv_t

where kstar = k*(k-1)/2, the number of comparisons, and all other
terms are defined as above.

The adjusted p-value is computed as

p_adj = 1 - (1-p)^kstar

where p is the unadjusted p-value and all other terms are defined as above.

In method, case does not matter, and the default is (historically)
mcompare(c gh t2).

hc3
uses (n-1) as the denominator for computing standard errors.
The resulting standard errors are equivalent to those reported by regress
for a model with a single categorical predictor that indicates the groups
when vce(hc3) is specified.
The default standard errors are equivalent to those of regress
when the vce(hc2) option is specified
and those reported by ttest with the unequal option.

welch
uses Welch's (1947) formula to approximate the degrees of freedom.
The default is to use Satterthwaite's (1946) approximation.

level(#)
specifies the confidence level, as a percentage, for confidence intervals.
The default is level(); see set level.

cieffects
reports mean differences, standard errors, and confidence intervals.
This is the default.

pveffects
reports mean differences, standard errors, test statistics, and p-values.

effects
reports mean differences, standard errors, test statistics, p-values, and confidence intervals.

varlabel
displays variable labels instead of variable names.
This option is not allowed with pwmci.

vallabel
displays value labels instead of numeric codes.
This option is not allowed with pwmci.

cformat(%fmt);
pformat(%fmt);
and sformat(%fmt)
specify how to format
differences of means,
standard errors,
confidence limits;
(adjusted) p-values;
and test statistics,
respectively.

notable
does not report the results; results are still stored in r().

Examples

. sysuse nlsw88

. pwmc wage , over(race)

. pwmci (1637 8.08 5.96) (583 6.84 5.08) (26 8.56 5.21)

Saved results

pwmc saves the following in r():

Scalars

r(k) number of groups

r(ks) number of pairwise comparisons

r(level) confidence level

Macros

r(cmd) pwmc

r(cmd2) pwmci (immediate command only)

r(depvar) varname from which means are
computed

r(over) varname from over()

r(mcmethod_vs) method from mcompare()

Matrices

r(table_vs) table of pairwise differences, standard
errors, test statistics, unadjusted p-values, and unadjusted
confidence intervals

References

Dunnett, C. W. 1980. Pairwise Multiple Comparisons in the Unequal Variance
Case, Journal of the American Statistical Association, 75(372), 796--800.

Games, P. A., & Howell, J. F. 1976. Pairwise Multiple Comparison
Procedures with Unequal N's and/or Variances: A Monte Carlo study,
Journal of Educational Statistics, 1(2), 113--125.

Satterthwaite, F. E. 1946. An approximate distribution of estimates of
variance components. Biometrics Bulletin, 2(6), 110--114.

Tamhane, A. C. 1979. A Comparison of Procedures for Multiple Comparisons
of Means with Unequal Variances, Journal of the American Statistical
Association, 74(366), 471--480.

Welch, B. L. 1947. The generalization of 'student's' problem when several different population variances are involved. Biometrika, 34(1/2), 28--35.

Acknowledgments

Andreas Franken and David Kremelberg
reported a bug on Linux OS.

Earlier versions of the software
borrowed from Matthew K. Lau's DTK package for R.

Support

Daniel Klein

klein.daniel.81@gmail.com

Also see

Online: pwmean, pwcompare, oneway, ttest

if installed: dunnett, prcomp