Learn R Programming

R Package “robust2sls”

The goal of robust2sls is to provide easy-to-use tools for outlier-robust inference and outlier testing in two-stage least squares (2SLS) models.

Installation

You can install the released version from CRAN with:

install.packages("robust2sls")

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("jkurle/robust2sls")

Introduction

For a detailed introduction to the model framework, the different trimmed 2SLS algorithms, and examples, see the vignette Introduction to the robust2sls Package.

utils::vignette("overview", package = "robust2sls")

Note about Versions of Dependencies

The Depends: and Suggests: fields in the DESCRIPTION file have no minimum or maximum version because I cannot test how far the package is compatible with older versions of the dependencies. However, I also did not want to require the versions that were used during the development to not force users to update their packages and potentially break their other existing code.

The following table lists the version of each package that was used in the development of the robust2sls package.

For your information, robust2sls was developed under the following versions:

  • R: version 4.1.1 (2021-08-10)
  • Imports:
    • AER: v1.2-9
    • doRNG: v1.8.2
    • foreach: v1.5.1
    • pracma: v2.3.3
  • Suggests:
    • doFuture: v0.12.0
    • doParallel: v1.0.16
    • future: v1.21.0
    • ggplot2: v3.3.5
    • knitr: v1.36
    • MASS: v7.3-54
    • parallel: v4.1.1
    • rmarkdown: v2.8
    • testthat: v3.0.2

Copy Link

Version

Install

install.packages('robust2sls')

Monthly Downloads

313

Version

0.2.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Jonas Kurle

Last Published

January 11th, 2023

Functions in robust2sls (0.2.2)

conv_diff

L2 norm between two most recent estimates
counttest

Count test
beta_hausman

Calculates a Hausman test on the difference between robust and full sample estimates
beta_inf

Calculates valid se for coefficients under H0 of no outliers
beta_t

Conducts a t-test on the difference between robust and full sample estimates
beta_test_avar

Calculates the asymptotic variance of the difference between robust and full sample estimators of the structural parameters
case_resampling

Uses nonparametric case resampling for standard errors of parameters and gauge
estimate_param

Estimation of moments of the data
gauge_covar

Asymptotic covariance of gauge
extract_boot

Extracts bootstrap results for a specific iteration
extract_formula

Extract the elements of ivreg formula
estimate_param_null

Estimation of moments of the data
generate_data

Random data of 2SLS model (Monte Carlo)
generate_param

Parameters of 2SLS model (Monte Carlo)
globaltest

Global test correcting for multiple hypothesis testing
evaluate_boot

Evaluate bootstrap results
multi_cutoff

Multiple models, varying cut-off
mvn_sup

Multivariate normal supremum simulation
iis_init

Impulse Indicator Saturation (IIS initial estimator)
new_robust2sls

Constructor of robust2sls class
gauge_avar

Asymptotic variance of gauge
multi_cutoff_to_fodr_vec

Creates a vector of the centered FODR across different cut-offs
mc_grid

Monte Carlo simulations parameter grid
outlier

Outlier history of single observation
outliers

Number of outliers
selection

Create selection (non-outlying) vector from model
outlier_detection

Outlier detection algorithms
nonparametric_resampling

Nonparametric resampling from a data frame
saturated_init

Saturated 2SLS (split-sample initial estimator)
robustified_init

Robustified 2SLS (full sample initial estimator)
robust2sls-package

robust2sls: A package for outlier robust 2SLS inference and testing
test_cpv

Critical and p-value for test statistic relative to simulated distribution
update_list

Append new iteration results to "robust2sls" object
nonmissing

Determine which observations can be used for estimation
selection_iis

Create selection (non-outlying) vector from IIS model
nonparametric

Create indices for nonparametric bootstrap
simes

Simes (1986) procedure for multiple testing
print.robust2sls

Helper of robust2sls class
proptest

Proportion test
varrho

Calculate varrho coefficients
user_init

User-specified initial estimator
validate_robust2sls

Validator of robust2sls class
outliers_prop

Proportion of outliers
plot.robust2sls

Plotting of standardised residuals and outliers
sumtest

Scaling sum proportion test across different cut-offs
suptest

Supremum proportion test across different cut-offs
count_indices

Counts the number of times each index was sampled
beta_inf_correction

Calculates the correction factor for inference under H0 of no outliers
constants

Calculate constants across estimation