Implements Rigobon's heteroskedasticity-based identification using discrete regime indicators. This is a wrapper around the Lewbel estimation framework that automatically constructs instruments from regime dummies.
Usage
run_rigobon_estimation(
data,
endog_var = "Y2",
exog_vars = "Xk",
regime_var = "regime",
df_adjust = "asymptotic",
return_diagnostics = FALSE
)
Arguments
- data
Data.frame. Must contain Y1, Y2, X variables, and regime indicator.
- endog_var
Character. Name of endogenous variable (default: "Y2").
- exog_vars
Character vector. Names of exogenous variables (default: "Xk").
- regime_var
Character. Name of regime indicator variable (default: "regime").
- df_adjust
Character. Degrees of freedom adjustment: "asymptotic" or "finite" (default: "asymptotic").
- return_diagnostics
Logical. Whether to return additional diagnostic information (default: FALSE).
Value
If return_diagnostics = FALSE: A list with:
ols: OLS estimates and standard errors
tsls: 2SLS estimates and standard errors using Rigobon instruments
first_stage_F: Vector of F-statistics for each instrument
If return_diagnostics = TRUE: Additionally returns:
instruments: Matrix of generated instruments
regime_props: Proportion of observations in each regime
heteroskedasticity_test: Test for regime-based heteroskedasticity
Details
The function:
Creates centered dummy variables for each regime
Estimates first-stage residuals
Constructs instruments as (centered regime dummy) * (first-stage residual)
Performs 2SLS estimation using all regime-based instruments
This implements the procedure described in Rigobon (2003) for identification through heteroskedasticity across discrete regimes.
References
Rigobon, R. (2003). Identification through heteroskedasticity. Review of Economics and Statistics, 85(4), 777-792. doi:10.1162/003465303772815727
See also
generate_rigobon_data
for generating regime-based data
Examples
if (FALSE) { # \dontrun{
# Generate Rigobon-style data
params <- list(
beta1_0 = 0.5, beta1_1 = 1.5, gamma1 = -0.8,
beta2_0 = 1.0, beta2_1 = -1.0,
alpha1 = -0.5, alpha2 = 1.0,
regime_probs = c(0.4, 0.6),
sigma2_regimes = c(1.0, 2.5)
)
data <- generate_rigobon_data(1000, params)
# Run Rigobon estimation
results <- run_rigobon_estimation(data)
print(results$tsls$estimates)
# With diagnostics
results_diag <- run_rigobon_estimation(data, return_diagnostics = TRUE)
print(results_diag$heteroskedasticity_test)
} # }