Package: ivdoctr 1.0.1

Mallick Hossain

ivdoctr: Ensures Mutually Consistent Beliefs When Using IVs

Uses data and researcher's beliefs on measurement error and instrumental variable (IV) endogeneity to generate the space of consistent beliefs across measurement error, instrument endogeneity, and instrumental relevance for IV regressions. Package based on DiTraglia and Garcia-Jimeno (2020) <doi:10.1080/07350015.2020.1753528>.

Authors:Frank DiTraglia [aut], Mallick Hossain [aut, cre]

ivdoctr_1.0.1.tar.gz
ivdoctr_1.0.1.tar.gz(r-4.5-noble)ivdoctr_1.0.1.tar.gz(r-4.4-noble)
ivdoctr_1.0.1.tgz(r-4.4-emscripten)ivdoctr_1.0.1.tgz(r-4.3-emscripten)
ivdoctr.pdf |ivdoctr.html
ivdoctr/json (API)
NEWS

# Install 'ivdoctr' in R:
install.packages('ivdoctr', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/emallickhossain/ivdoctr/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:
  • afghan - Burde and Linden (2013, AEJ Applied) Dataset
  • colonial - Acemoglu, Johnson, and Robinson (2001) Dataset
  • weber - Becker and Woessmann (2009) Dataset

openblascpp

2.81 score 13 scripts 208 downloads 3 exports 90 dependencies

Last updated 3 years agofrom:0176baf9da. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKDec 21 2024
R-4.5-linux-x86_64OKDec 21 2024

Exports:ivdoctrmakeTableplot_3d_beta

Dependencies:abindAERbackportsbase64encbootbroombslibcachemcarcarDataclicodacolorspacecowplotcpp11data.tableDerivdigestdoBydplyrevaluatefansifarverfastmapfontawesomeFormulafsgenericsggplot2gluegtablehighrhtmltoolshtmlwidgetsisobandjquerylibjsonliteknitrlabelinglatticelifecyclelme4lmtestmagrittrMASSMatrixMatrixModelsmemoisemgcvmicrobenchmarkmimeminqamodelrmunsellnlmenloptrnnetnumDerivpbkrtestpillarpkgconfigpurrrquantregR6rappdirsRColorBrewerRcppRcppArmadilloRcppEigenrglrlangrmarkdownsandwichsassscalesSparseMstringistringrsurvivaltibbletidyrtidyselecttinytexutf8vctrsviridisLitewithrxfunyamlzoo

Example 1: Colonial Origins

Rendered fromcolonial-origins.Rmdusingknitr::rmarkdownon Dec 21 2024.

Last update: 2021-12-05
Started: 2020-07-03

Readme and manuals

Help Manual

Help pageTopics
Burde and Linden (2013, AEJ Applied) Datasetafghan
B function from Proposition A3b_functionA3
Evaluates the corners given user bounds. Vectorized wrt multiple draws of obs.candidate1
Evaluates the edge where k is on the boundary. Vectorized wrt multiple draws of obs.candidate2
Evaluates the edge where r_TstarU is on the boundary.candidate3
Collapse 3-d array to matrixcollapse_3d_array
Acemoglu, Johnson, and Robinson (2001) Datasetcolonial
Computes bounds for simulated datadraw_bounds
Simulates different data drawsdraw_observables
Draws covariance matrix using the Jeffrey's Priordraw_sigma_jeffreys
Creates LaTeX code for parameter estimatesformat_est
Creates LaTeX code for the HPDIformat_HPDI
Creates LaTeX code for the standard errorformat_se
G function from Proposition A.2g_functionA2
Computes a0 and a1 boundsget_alpha_bounds
Solves for betaget_beta
Returns beta bounds in binary case using grid searchget_beta_bounds_binary
Generates beta bounds off of beta drawsget_beta_bounds_binary_post
Wrapper function combines all unrestricted bounds together. Vectorizedget_bounds_unrest
Computes OLS and IV estimatesget_estimates
Given observables from the data, generates unrestricted bounds for kappa. Vectorizedget_k_bounds_unrest
Computes L, lower bound for kappa_tilde in paperget_L
Solves for the magnification factorget_M
Computes beliefs that support valid instrumentget_new_draws
Given data and function specification, returns the relevant correlations and covariances with any exogenous controls projected out.get_observables
Compute the share of draws that could contain a valid instrument.get_p_valid
Computes the lower bound of psi for binary dataget_psi_lower
Computes the upper bound of psi for binary dataget_psi_upper
Given observables from the data, generates the unrestricted bounds for rho_TstarU. Data does not impose any restrictions on r_TstarU Vectorizedget_r_TstarU_bounds_unrest
Solves for r_uz given observables, r_TstarU, and kappaget_r_uz
Evaluates r_uz bounds given user restrictions on r_TstarU and kappaget_r_uz_bounds
Given observables from the data, generates the unrestricted bounds for rho_uz. Vectorizedget_r_uz_bounds_unrest
Solves for the variance of the error term uget_s_u
Computes coverage of list of intervalsgetCoverage
Generates smallest covering intervalgetInterval
Generates parameter estimates given user restrictions and dataivdoctr
Takes the OLS and IV estimates and converts it to a row of the LaTeX tablemake_full_row
Makes LaTeX code to make a row of a table and shift by some amount of columns if necessarymake_tex_row
Generates table of parameter estimates given user restrictions and datamakeTable
Generates a custom color palette given a vector of numbersmap2color
Rounds x to two decimal placesmyformat
Plot ivdoctr Restrictionsplot_3d_beta
Construct vectors of points that outline a rectangle.rect_points
Simulate draws from the inverse Wishart distributionrinvwish
Convert 3-d array to list of matrixestoList
Becker and Woessmann (2009) Datasetweber