ivdoctr {ivdoctr} | R Documentation |
Generates parameter estimates given user restrictions and data
Description
Generates parameter estimates given user restrictions and data
Usage
ivdoctr(
y_name,
T_name,
z_name,
data,
example_name,
controls = NULL,
robust = FALSE,
r_TstarU_restriction = c(-1, 1),
k_restriction = c(1e-04, 1),
n_draws = 5000,
n_RF_draws = 1000,
n_IS_draws = 1000,
resample = FALSE
)
Arguments
y_name |
Character string with the column name of the dependent variable |
T_name |
Character string with the column name of the endogenous regressor(s) |
z_name |
Character string with the column name of the instrument(s) |
data |
Data frame |
example_name |
Character string naming estimation |
controls |
Vector of character strings specifying the exogenous variables |
robust |
Indicator for heteroskedasticity-robust standard errors |
r_TstarU_restriction |
2-element vector of min and max of r_TstarU. |
k_restriction |
2-element vector of min and max of kappa. |
n_draws |
Number of draws when generating frequentist-friendly draws of the covariance matrix |
n_RF_draws |
Number of reduced-form draws |
n_IS_draws |
Number of draws on the identified set |
resample |
Indicator of whether or not to resample using magnification factor |
Value
List with elements:
ols: lm object of OLS estimation,
iv: ivreg object of the IV estimation
n: Number of observations
b_OLS: OLS point estimate
se_OLS: OLS standard errors
b_IV: IV point estimate
se_IV: IV standard errors
k_lower: lower bound of kappa
p_empty: fraction of parameter draws that yield an empty identified set
p_valid: fraction of parameter draws compatible with a valid instrument
r_uz_full_interval: 90% posterior credible interval for fully identified set of rho
beta_full_interval: 90% posterior credible interval for fully identified set of beta
r_uz_median: posterior median for partially identified rho
r_uz_partial_interval: 90% posterior credible interval for partially identified set of rho under a conditionally uniform reference prior
beta_median: posterior median for partially identified beta
beta_partial_interval: 90% posterior credible interval for partially identified set of beta under a conditionally uniform reference prior
a0: If treatment is binary, mis-classification probability of no-treatment case. NULL otherwise
a1: If treatment is binary, mis-classification probability of treatment case. NULL otherwise
psi_lower: lower bound for psi
binary: logical indicating if treatment is binary
k_restriction: User-specified bounds on kappa
r_TstarU_restriction: User-specified bounds on r_TstarU
Examples
library(ivdoctr)
endog <- c(0, 0.9)
meas <- c(0.6, 1)
colonial_example1 <- ivdoctr(y_name = "logpgp95", T_name = "avexpr",
z_name = "logem4", data = colonial,
controls = NULL, robust = FALSE,
r_TstarU_restriction = endog,
k_restriction = meas,
example_name = "Colonial Origins")