18
Stata Technical Bulletin
STB-22
mcomprl displays lists of categories whose mean responses are insignificantly different from each other. The varname following
the command name contains the p values, calculated by mcompp, that determine whether differences are significant.
The cutoff () option specifies the p value to be used in grouping categories. The default cutoff is 5 percent.
The default () option supplies a name for the default or omitted category. Since the dummy variable for this category
is omitted from the regression, mcomprl has no way of finding its name. If you omit this option, mcomprl uses the string
“default” to identify this category.
The id() and generate() options specify variables in which to store the lists produced by mcomprl. These options are
provided for users who wish to write more elaborate report writing programs than mcomprl. There is no reason to specify these
options when using mcomprl interactively.
The label option indicates that variable labels, rather than variable names, are to be used in the lists of categories. The
default is to display the names of the dummy variables when listing groups of similar categories.
Continuing with our original example, we can use mcomprl to display the groups of repair record categories that have
similar auto prices. We use the Scheffe p values as the criterion, and we label the dummy variables to make the output more
readable. For the sake of the example, we set the cutoff to 50 percent. In practice, you would generally leave the cutoff at its
default level of 5 percent. We also add a label (“Poor”) for the omitted category.
. label var r2 Fair
. label var r3 Average
. label var r4 Good
. label var rδ Excellent
. mcomprl schpl, label default(Poor) cutoff(0.5)
Group A
Poor
Fair
Average
Good
Group B
Good
Excellent
According to this report, cars in the lowest four repair record categories have similar prices, as do cars in the highest two repair
record categories.
mcompr2: Report significant pairwise differences
mcompr2 is the converse of mcomprl: instead of reporting groups of similar categories, mcompr2 reports of pairs of
categories with significantly different mean responses. The syntax of mcompr2 is similar to that of mcomprl:
mcompr2 varname [, cutoff(#) default (aamee) effects label ]
As before, the varname following the command name contains the p values calculated by mcompp. The default () and label
options have the same meaning in mcompr2 as in mcomprl. The cutoff () option works slightly differently, though. By default,
all pairwise contrasts are printed along with their p values. If the cutoff () option is specified, only contrasts with p values
less than the cutoff are displayed. If the effects option is specified, the effects (contrasts) are also printed.
The following listing continues with the example of the auto price model and illustrates the behavior of mcompr2:
. mcompr2 schpl
Group Group P-value
r5 |
r3 |
0.0927 |
r5 |
r2 |
0.1977 |
r5 |
default |
0.3466 |
r5 |
r4 |
0.5257 |
r4 |
r3 |
0.7040 |
r4 |
default |
0.8093 |
r4 |
r2 |
0.8138 |
r3 |
default |
0.9787 |
r2 |
default |
0.9927 |
r3 |
r2 |
0.9997 |