https://github.com/apoorvalal/ivdiag
IV diagnostics package accompanying Lal, Lockhart, Xu, and Zu (2023).
https://github.com/apoorvalal/ivdiag
bootstrap econometrics instrumental-variable sensitivity-analysis
Last synced: about 1 year ago
JSON representation
IV diagnostics package accompanying Lal, Lockhart, Xu, and Zu (2023).
- Host: GitHub
- URL: https://github.com/apoorvalal/ivdiag
- Owner: apoorvalal
- License: other
- Created: 2021-08-15T04:00:31.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T17:47:43.000Z (almost 2 years ago)
- Last Synced: 2025-04-12T23:38:18.231Z (about 1 year ago)
- Topics: bootstrap, econometrics, instrumental-variable, sensitivity-analysis
- Language: R
- Homepage: https://arxiv.org/abs/2303.11399
- Size: 2.75 MB
- Stars: 7
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ivDiag
[](https://www.tidyverse.org/lifecycle/#stablel)
[](https://opensource.org/licenses/MIT)
[](https://www.datasciencemeta.com/rpackages)
**`ivDiag`** is toolkit for estimation and diagnostics with instrumental variable (IV) designs. It provides `R` implementations of the guidelines proposed in Lal et al. (2023), enabling researchers to obtain reliable and robust estimates of their IV models.
**Examples:** `R` code used in the [tutorial](https://yiqingxu.org/packages/ivDiag/articles/iv_tutorial.html) can be downloaded from [here](https://raw.githubusercontent.com/apoorvalal/ivDiag/master/pkgdown/ivDiag_examples.R).
**Reference:** : Lal, Apoorva, Mackenzie William Lockhart, Yiqing Xu, and Ziwen Zu (2023). [How Much Should We Trust Instrumental Variable Estimates in Political Science? Practical Advice Based on 67 Replicated Studies](https://yiqingxu.org/papers/english/2021_iv/LLXZ.pdf), Mimeo, Stanford University.
***
## Installation
You can install the **ivDiag** package from CRAN:
```{r eval=FALSE}
install.packages("ivDiag", repos='http://cran.us.r-project.org')
```
You can also install the up-to-date development version from Github:
```{r eval=FALSE}
library(remotes)
install_github("apoorvalal/ivDiag")
```
**ivDiag** depends on the following packages, which will be installed automatically when **ivDiag** is being installed:
```{r eval=FALSE}
require(foreach)
require(future)
require(doParallel)
require(lfe)
require(fixest)
require(ggplot2)
require(ggfortify)
require(wCorr)
require(haven)
require(glue)
require(patchwork)
require(testthat)
```
You can use the following code to install the required packages:
```{r eval=FALSE}
install_all <- function(packages) {
installed_pkgs <- installed.packages()[, "Package"]
for (pkg in packages) {
if (!pkg %in% installed_pkgs) {
install.packages(pkg)
}
}
}
packages <- c("foreach", "future", "doParallel", "lfe", "fixest", "ggplot2",
"ggfortify", "wCorr", "haven", "glue", "patchwork", "testthat")
install_all(packages)
```
***
## Report bugs
This package is a work in progress. [Github](https://github.com/apoorvalal/ivDiag) issues and/or pull requests are welcome.