Skip to contents

One-call pipeline

Build the dataset, run the whole workflow, and return the interval comparison, the effective first-stage F, and every diagnostic in a single call.

ssbartik()
One-call shift-share analysis
ssb_pipeline()
Run the full shift-share analysis pipeline

Design

Assemble shares, shocks and controls into one object and choose the identification route (exogenous = "share" or "shift"); everything downstream reads from it.

ssb_design()
Define a shift-share (Bartik) IV design

Estimation and exposure-robust inference

Point estimates with IID / EHW / cluster / two-way standard errors and the exposure-robust AKM and AKM0 confidence sets (via ‘ShiftShareSE’), plus first-stage strength and the location/shock-level equivalence check.

ssb_estimate()
Estimate a shift-share IV regression with several confidence intervals
ssb_first_stage()
First-stage strength: standard and exposure-robust (effective) F
ssb_equivalence()
Check the location-level / shock-level equivalence

Exogenous-shares diagnostics (Rotemberg)

Which shocks carry identification, how concentrated exposure is, and whether the shares look exogenous — following Goldsmith-Pinkham, Sorkin and Swift (2020).

ssb_rotemberg()
Rotemberg weights for a Bartik instrument
ssb_weight_summary()
Rotemberg-weight summary and correlations (GPSS diagnostic table)
ssb_share_balance()
Share balance (exogenous-shares route)

Exogenous-shifts diagnostics

Shock-level summaries, correlation balance across shocks, the shock-level IV, and the over-identification test across single-share instruments.

ssb_shock_summary()
Shock summary: effective number of shocks and exposure concentration
ssb_shock_balance()
Shock-level balance test
ssb_shock_iv()
Shock-level IV estimate
ssb_overid()
Overidentification / cross-instrument homogeneity test

Robustness and validity checks

Leave-one-out and drop-top sensitivity, pre-trend and placebo tests, randomization inference, recentering, and shock aggregation.

ssb_loo()
Leave-one-sector-out sensitivity
ssb_drop_top()
Re-estimate after dropping the top-weight shocks
ssb_pretrend()
Pre-trend test
ssb_placebo()
Placebo-outcome test
ssb_ri()
Randomization-inference (placebo-shock) test
ssb_recenter()
Recenter the shocks (Borusyak & Hull)
ssb_aggregate()
Aggregate a shift-share design to the shock (shifter) level

Plots

ggplot2 figures for the interval comparison, leave-one-out sensitivity, dispersion of just-identified estimates, exposure concentration, and the randomization-inference null.

ssb_plot_ci()
Plot the confidence-interval comparison
ssb_plot_loo()
Leave-one-out sensitivity plot
ssb_plot_overid()
Overidentification dispersion plot
ssb_plot_shocks()
Exposure-concentration (Lorenz) plot
ssb_plot_ri()
Randomization-inference plot
ssb_plot_rotemberg()
Plot Rotemberg weights (canonical GPSS figure)

Publication-ready tables

Render any result table as a booktabs-style PNG/PDF image (plot(x, file = ...)), or as LaTeX / Markdown source via the format() methods below.

plot(<ssb_estimate>) plot(<ssb_weight_summary>) plot(<ssb_overid>) plot(<ssb_loo>) plot(<ssb_drop_top>)
Render a result table as an image (PNG or PDF)
plot(<ssb_rotemberg>)
Render the Rotemberg-weight table as a compact booktabs figure
format(<ssb_estimate>)
Render the estimate / standard-error table as LaTeX or Markdown
format(<ssb_rotemberg>)
Render the Rotemberg-weight table as paste-ready LaTeX or Markdown
format(<ssb_weight_summary>)
Render a Rotemberg-weight summary as LaTeX or Markdown
format(<ssb_overid>)
Render an overidentification test as LaTeX or Markdown
format(<ssb_loo>)
Render a leave-one-out table as LaTeX or Markdown
format(<ssb_drop_top>)
Render a drop-top-shocks comparison as LaTeX or Markdown
format(<ssb_shocks>)
Render a shock-exposure summary as LaTeX or Markdown
format(<ssb_shock_balance>)
Render a shock-balance test as LaTeX or Markdown

Package overview

ssBartik ssBartik-package
ssBartik: an end-to-end pipeline for shift-share (Bartik) IV designs