*! version 1.0.0 18 August 2014

help for arrowplot

Title

arrowplot -- Combined plot for graphing inter-group and intra-group trends

Syntax

arrowplot yvar xvar [if] [in] [weight], groupvar(varname) [options]

Options
linesize(#) Sets the size of arrows for each intra-group trend. If not specified, a default value is chosen based on the range of the y-axis.

controls(varlist) Allows for additional independent variables to be included as controls in intra-group regression trends.

groupname(string) Changes "inter-group" in the graph legend to "inter-groupname" where groupname is specified by the user (eg "inter-country").

regopts(regress options) Allows for any regression options such as clustering.

generate(newvar) Produces a new variable containing inter-group (conditional) correlations.

twoway_options Any options documented in [G-3] twoway_options

Description

arrowplot creates graphs showing inter-group and intra-group variation by overlaying arrows for intra-group (regression) trends on a scatter plot.
This is similar to the well known Stevenson-Wolfers happiness graphs. arrowplot requires the definition of a yvar and xvar (plotted on
the y- and x-axis respectively), as well as the definition of a groupvar which is the group over which the plot should be made (for example: country,
region, industry).

arrowplot allows for intra-group (regression) trends to be either unconditional, or conditional upon any number of independent control variables.
Similarly, intra-group regression trends allow for weighting, and any other regression options permitted in Stata's regress command.

Options

linesize(#) Defines the size of the arrows which plot the intra-group trends. If not specified, arrows are defined to
be the equivalent of 8 percent of the range of the y-axis of the plot. If this option is used, the size should be expressed in terms of units of the
variable on the y-axis.

controls(varlist) Allows for intra-group (regression) trends to be conditional on additional independent variables. This
option allows for factor variables and other wildcards.

groupname(string) Changes the legend on the plot to replace the general term 'intra-group', with 'intra-newname', where
newname should be passed as the argument to groupname. For example, specifying groupname(Country), will result in a legend
which displays 'Intra-Country'.

regopts(regress options) Allows for any other regression options to be included when calculating
intra-group (conditional) regression trends.

generate(newvar) Produces a new variable in the user's dataset. This variable contains the intra-group regression trend for each
group. The value of this variable is (necessarily) identical for each observation within a given group.

twoway_options Allows for the inclusion of any additional graphing options such as titles, axes, added lines, etc.

Examples

Plot inter- and intra-industry wage versus education using NLSW survey

Setup

. webuse nlswork

. gen ind="industry "

. egen industry=concat(ind ind_code)

. arrowplot ln_wage grade, groupvar(industry)

Plotting inter- and intra-industry wage versus education conditonal on an individual's union status and tenure

. arrowplot ln_wage grade, groupvar(industry) controls(union tenure)

Plotting the same graph without missings, and with graph titles, labels, etc.

. arrowplot ln_wage grade if ind_code!=., groupvar(industry) controls(union tenure) title(Education and Log Wage) subtitle(NLS 1968: Women 14-26) xtitle(Grade of Education) ytitle(Log Wage) scheme(s1color)

References

Betsey Stevenson & Justin Wolfers, 2008.
"Economic Growth and Subjective Well-Being: Reassessing the Easterlin Paradox",
Brookings Papers on Economic Activity, Economic Studies Program, The Brookings Institution, vol. 39(1) (Spring), pages 1-102.

Acknowledgements

Thanks to George Vega Yon for useful comments.

Also see

Help: plot, pcarrow, scatter

Author

Damian Clarke, Department of Economics, University of Oxford. mailto:damian.clarke@economics.ox.ac.uk