*! version 1.0.0 April 23, 2018 @ 09:14:12

Title

bartik_weight -- Calculate Rotemberg Weights from Goldsmith-Pinkham, Sorkin and Swift (2018)

Syntax

bartik_weight
, y(varname) x(varname) z(varlist) weightstub(varlist) [options]

Main
y(varname) outcome variable

x(varname) endogeous variable

z(varlist) variable list of instruments

weightstub(varlist) variable list of weights

Options
controls(varlist) list of control variables

absorb(varname) fixed effect to absorb

weight_var(varname) name of analytic weight variable for regression

by(varname) name of the time variable that is interacted with the shares

Description

bartik_weight calculates the Rotemberg weights over the
instruments specified in the varlist of z(varlist) using the
weights defined by weightstub(). The data needs to be stored in a
wide fashion, with a varlist of instruments and growth
rates that make up the underlying Bartik instrument.

For more details, see the remarks
and Goldsmith-Pinkham, Sorkin and Swift (2018).

Details

Main

y(varname) specifies the outcome variable in the structural equation. y() is required.

x(varname) specifies the endogeneous variable in the structural equation. x() is required.

z(varlist) specifies the varlist instruments used to
make up the Bartik instrument. See Goldsmith-Pinkham, Sorkin and Swift
(2018) for a full description. z() is required.

weightstub(varlist) specifies the varlist weights
used to make up the weight matrix for the Rotemberg weights. These
weights will be collapsed to constract a single matrix. See
Goldsmith-Pinkham, Sorkin and Swift (2018) for a full
description. weightstub() is required.

Options

controls(varlist) is the list of variables used as
controls in the main regression. In cases with a variable that
generates a lot of fixed effects (such as a location F.E.), the absorb(varname)
option can be used, and the program will construct
temporary variables to run the regression.

absorb(varname) specifies the categorical variable,
which is to be included in the regression as if it were specified by
dummy variables.

weight_var(varname) specifies the weight variable used to
weight the regression. In a standard regression, the varname
would be the variable used in [aweight=varname].

by(varname) specifies name of the time variable that is
interacted with the shares. The variable is omitted when the
regression is a cross-section, while in a panel setting, this would be
each time period that the national growth rates are defined in.

Remarks

This program estimates the Rotemberg weights outlined in
Goldsmith-Pinkham, Sorkin and Swift (2018). Each weight returned in
r(alpha) corresponds to the misspecification elasticity for each
individual instrument, when using the Bartik instrument defined by the
weights in weightstub().

The key errors or issues that can come up are that the
instruments or controls are collinear. For two example of do-files
implementing this process, see example_BAR.do and example_ADH.do which
implement the program using real data.

For detailed information on the Rotemberg weights statistic, see Goldsmith-Pinkham, Sorkin and Swift (2018).

Examples

Three simple examples:

. bartik_weight, z(ind_sh_*) weightstub(growth_*) x(emp_ch) y(wage_ch)

. bartik_weight, z(t*_init_sh_ind_*) weightstub(nat_empl_ind_*) x(emp_ch) y(wage_ch) controls(`controls') weight_var(pop1980) absorb(czone)

. bartik_weight, z(t*_sh_ind_*) weightstub(trade_*) x(d_tradeusch_pw) y(d_sh_empl_mfg) controls(`controls') weight_var(timepwt48)

For code to convert returned matrices into a dataset, see example_ADH.do or example_BAR.do.

Stored results

bartik_weight stores the following in r():

Matrices

r(alpha) Rotemberg weight vector

r(beta) just-identified coefficient vector

r(G) growth weight vector