I (co-)wrote three R packages. One is based on an article in Political Analysis explaining how strategic models can incorporate selection models and provide unbiased estimates. The second package was written for a class I teach where I wanted to rely on MrP estimates. The third package is a collaboration with Philipp Broniecki and Reto Wüest and leverages machine learning to improve MrP models.

  • autoMrP: This R-package allows users to estimate various MrP models. By default five classifiers (best subset, Lasso, SVM, PCA, and GB) are estimated and combined via ensemble Bayesian model averaging. The package also provides the option to generate uncertainty estimates based on a bootstrapping procedure which is computationally intensive. Users can also add additional classifiers or select a subset of the default set. This is based on joint work with Philipp Broniecki and Reto Wüest.
  • StratSel: This R-package implements an estimator which explicitly models a strategic interaction based on quantal response equilibria. What distinguishes this estimator from standard QRE estimators (as found in the R package Games) is that it is not prone to selection bias even if the unobserved components are correlated. The package contains functions to estimate a SSM (strategic selection model), generate predictions, plot predictions, and export results to LaTeX. In addition, the package contains a function to create dyadic data sets.
  • swissMrP: This package implements a number of functions to create small area predictions based on Swiss survey data. The main purpose of the package is to facilitate the use of MrP (multilevel regression with post-stratification) in a class I taught in 2013 (and 2014, 2015, 2016, 2017, 2018) at the University of Zurich. The package allows to generate MrP estimates, to plot them, and to draw maps showing the geographic variation in opinions.
    You can install the package from GitHub: