*! version 1.0.0 E Brini, ST Borgen, NT Borgen 28sept2023
help pheatplot

Title

pheatplot -- Compare pairwise p-values

Syntax

pheatplot varname,
[differences
interaction(varname)
frame(newframename)
pname(name)
bname(name)
heatoptsp(options)
heatoptsb(options)
pvalues(off)
save(filename)
hexplot]

options

differences requests that heatplot of differences between coefficients is displayed.

interaction(varname) specifies the interaction variable, if
any.

frame(newframename) specifies the name of the frame that holds
coefficients, standard errors, p-values, and confidence intervals.

pname(name) provides a name for the heatplot of the p-values.

bname(name) provides a name for the heatplot of the coefficients.

heatoptsp(options) passes options along to the heatplot
of the p-values.

heatoptsb(options) passes options along to the heatplot
of the coefficients.

pvalues(off) removes the numeric display of p-values from heatplot of p-values.

save(filename) saves a table holding results.

hexplot requests that hexagon plots are used instead of heat plots.

Description

pheatplot is a postestimation command that calculates
pairwise comparisons of estimates using lincom and visualizes the
differences and the p-values of the difference in heatplots. The categorical
variable that will be compared is placed after the command name, followed by
options. In the previous regression model, the categorical variable must be
included using factor-variables (fvvarlist).

See Brini, Borgen, and Borgen (2023)
for descriptions and examples of the pheatplot command.

Options

differences requests that heatplot of differences between coefficients is displayed. The
default is that the plot of differences between coefficients is not shown.

interaction(varname) specifies the interaction variable, if
any. Interactions must be included using factor-variable operators
(fvvarlist).

frame(newframename) specifies the name of the frame that holds
coefficients, standard errors, p-values, and confidence intervals.
Specifying a frame will return a frame after the program ends.

pname(name) provides a name for the heatplot of the
p-values.

bname(name) provides a name for the heatplot of the
coefficients.

heatoptsp(options) affects rendition of the p-value plot. Options specified
here is passed along to the heatplot
of the p-values. See heatplot options for
list of available options.

heatoptsb(options) affects rendition of the coefficient plot. Options specified
here is passed along to the heatplot of the coefficients.
See heatplot options for list of available options.

pvalues(off) removes the numeric display of p-values in the heatplot
of the p-values. This option should be used in combination with
heatoptsp(values(options)) if the user wants to customize the display of p-values.

save(filename) saves a table in .docx format which includes difference between
coefficients, standard errors, and p-values.

hexplot requests that hexagon plots are used instead of heat plots. The default
is that the user-contributed command heatplot is used rather than hexplot.

Examples

Setup

. sysuse nlsw88, clear

. drop if inlist(occupation,9,10,12)

Test differences in occupation dummies.

. regress wage i.occupation

. pheatplot occupation

Test difference in union effects by occupation dummies.

. regress wage i.occupation##i.union

. pheatplot occupation, interaction(i.union)

Test difference in age effects by occupation dummies.

. regress wage i.occupation##c.age

. pheatplot occupation, interaction(c.age)

Stored results

pheatplot stores the following in r():

Matrices

r(pvalues) matrix holding p-values

r(differences) matrix holding differences between coefficients

Version requirements

The pheatplot command requires Stata 17.0 or later.

Package dependencies

pheatplot uses heatplot to visualize the p-values and differences between coefficients.
To install this command, type:

. ssc install heatplot

Reference

Brini, Elisa, Solveig T. Borgen, and Nicolai T. Borgen (2023).
Avoiding the eyeballing fallacy: Visualizing statistical differences between
estimates using the pheatplot command. SocArXiv.
doi:10.31235/osf.io/fghcd

Jann, Ben (2019).
HEATPLOT: Stata module to create heat plots and hexagon plots. Statistical
Software Components S458598, Boston College Department of Economics.

Authors

Elisa Brini, University of Oslo

elisa.brini@sosgeo.uio.no

Solveig T. Borgen, University of Oslo

s.t.borgen@sosgeo.uio.no

Nicolai T. Borgen, Oslo Metropolitan University

n.t.borgen@isp.uio.no