reg_ss.fit: Inference in a shift-share regression

View source: R/ols.R

reg_ss.fitR Documentation

Inference in a shift-share regression

Description

Basic computing engine to calculate confidence intervals and p-values in shift-share designs using different inference methods, as specified by method.

Usage

reg_ss.fit(
  y,
  X,
  W,
  Z,
  w = NULL,
  method = c("akm", "akm0"),
  beta0 = 0,
  alpha = 0.05,
  region_cvar = NULL,
  sector_cvar = NULL
)

Arguments

y

Outcome variable, vector of length N, with each row corresponding to a region.

X

Shift-share vector with length N of sectoral shocks, aggregated to regional level using the share matrix W. That is, each element of X corresponds to a region.

W

A matrix of sector shares, so that W[i, s] corresponds to share of sector s in region i. The ordering of the regions must coincide with that in the other inputs, such as X. The ordering of the sectors in the columns of W is irrelevant but the identity of the sectors in must coincide with those used to construct X.

Z

Matrix of regional controls, matrix with N rows corresponding to regions.

w

vector of weights (length N) to be used in the fitting process. If not NULL, weighted least squares is used with weights w, i.e., sum(w * residuals^2) is minimized.

method

Vector specifying which inference methods to use. The vector elements have to be one or more of the following strings:

"homosk"

Assume i.i.d. homoskedastic errors

"ehw"

Eicker-Huber-White standard errors

"region_cluster"

Standard errors clustered at regional level

"akm"

Adão-Kolesár-Morales

"akm0"

Adão-Kolesár-Morales with null imposed. Note the reported standard error for this method corresponds to the normalized standard error, given by the length of the confidence interval divided by 2z_{1-alpha/2}

"all"

All of the methods above

beta0

null that is tested (only affects reported p-values)

alpha

Determines confidence level of reported confidence intervals, which will have coverage 1-alpha.

region_cvar

A vector with length N of cluster variables, for method "cluster_region". If the vector 1:N is used, clustering is effectively equivalent to ehw

sector_cvar

A vector with length S of cluster variables, if sectors are to be clustered, for methods "akm" and "akm0". If the vector 1:S is used, this is equivalent to not clustering.

Value

Returns an object of class "SSResults" containing the estimation and inference results. The print function can be used to print a summary of the results. The object is a list with at least the following components:

beta

Point estimate of the effect of interest beta

se, p

A vector of standard errors and a vector of p-values of the null H_0 : beta = beta0 for the inference methods in method, with beta0 specified by the argument beta0. For the method "akm0", the standard error corresponds to the effective standard error (length of the confidence interval divided by 2*stats::qnorm(1-alpha/2))

ci.l, ci.r

Upper and lower endpoints of the confidence interval for the effect of interest beta, for each of the methods in method


ShiftShareSE documentation built on April 24, 2022, 9:05 a.m.