name: Econometrics topic: Econometrics maintainer: Achim Zeileis, Grant McDermott, Kevin Tappe email: Achim.Zeileis@R-project.org version: 2022-09-13 source: https://github.com/cran-task-views/Econometrics/
Base R ships with a lot of functionality useful for (computational) econometrics,
in particular in the stats package. This functionality is complemented by many
packages on CRAN, a brief overview is given below. There is also a certain
overlap between the tools for econometrics in this view and those in the task
views on r view("Finance")
, r view("TimeSeries")
, and r view("CausalInference")
.
The packages in this view can be roughly structured into the following topics. If you think that some package is missing from the list, please file an issue in the GitHub repository or contact the maintainer.
lm()
(from stats) and standard
tests for model comparisons are available in various methods such as
summary()
and anova()
.summary()
and anova()
methods that also support asymptotic
tests (z instead of t tests, and Chi-squared instead of F tests) and
plug-in of other covariance matrices are coeftest()
and waldtest()
in
r pkg("lmtest", priority = "core")
. Tests of more general linear hypotheses
are implemented in linearHypothesis()
and for nonlinear hypotheses in
deltaMethod()
in r pkg("car", priority = "core")
.r pkg("sandwich", priority = "core")
and can be
plugged into the inference functions mentioned above.r pkg("lmtest")
(encompassing test, J test,
Cox test). The Vuong test for comparing other non-nested models is provided
by r pkg("nonnest2")
(and specifically for count data regression in
r pkg("pscl")
).r pkg("car")
and r pkg("lmtest")
provide a large collection of regression diagnostics and diagnostic tests.r pkg("fixest", priority = "core")
, which provides a number of in-built
convenience features that users may find attractive. This includes
robust standard error specification, multi-model estimation, custom
hypothesis testing, etc.glm()
from package stats. This includes in particular logit and probit
models for modeling choice data and Poisson models for count data.r pkg("effects")
. Marginal effect tables and
corresponding visualizations for a wide range of models can be be produced
with r pkg("marginaleffects", priority = "core")
. Other implementations
of marginal effects for certain models are in r pkg("margins")
and
r pkg("mfx")
. Interactive visualizations of both effects and marginal
effects are possible in r pkg("LinRegInteractive")
.glm()
with
family = binomial
. Bias-reduced GLMs that are robust to complete and
quasi-complete separation are provided by r pkg("brglm")
. Discrete choice
models estimated by simulated maximum likelihood are implemented in
r pkg("Rchoice")
. r pkg("bife")
provides binary choice models with fixed
effects. Heteroscedastic probit models (and other heteroscedastic GLMs) are
implemented in r pkg("glmx")
along with parametric link functions and
goodness-of-link tests for GLMs.glm()
with family = poisson
as explained above. Negative
binomial GLMs are available via glm.nb()
in package r pkg("MASS")
.
Another implementation of negative binomial models is provided by
r pkg("aod")
, which also contains other models for overdispersed data.
Zero-inflated and hurdle count models are provided in package r pkg("pscl")
.
A reimplementation by the same authors is currently under
development in r rforge("countreg")
on R-Forge which also encompasses
separate functions for zero-truncated regression, finite mixture models etc.multinom()
from package r pkg("nnet")
.
An implementation with both individual- and choice-specific variables is
r pkg("mlogit")
. Generalized multinomial logit models
(e.g., with random effects etc.) are in r pkg("gmnl")
. A flexible
framework of various customizable choice models (including multinomial logit
and nested logit among many others) is implemented in the r pkg("apollo")
package. Generalized additive models (GAMs) for multinomial responses can be
fitted with the r pkg("VGAM")
package. A Bayesian approach to multinomial
probit models is provided by r pkg("MNP")
. Various Bayesian multinomial
models (including logit and probit) are available in r pkg("bayesm")
.
Furthermore, the package r pkg("RSGHB")
fits various hierarchical Bayesian
specifications based on direct specification of the likelihood function.polr()
from package r pkg("MASS")
. The package
r pkg("ordinal")
provides cumulative link models for ordered data which
encompasses proportional odds models but also includes more general
specifications. Bayesian ordered probit models are provided by
r pkg("bayesm")
.survreg()
in r pkg("survival")
, a convenience interface
tobit()
is in package r pkg("AER", priority = "core")
. Further censored
regression models, including models for panel data, are provided in
r pkg("censReg")
. Censored regression models with conditional
heteroscedasticity are in r pkg("crch")
. Furthermore, hurdle models for
left-censored data at zero can be estimated with r pkg("mhurdle")
. Models
for sample selection are available in r pkg("sampleSelection")
and
r pkg("ssmrob")
using classical and robust inference, respectively. Package
r pkg("matchingMarkets")
corrects for selection bias when the sample is
the result of a stable matching process (e.g., a group formation or college
admissions problem).r pkg("crch")
for truncated (and potentially
heteroscedastic) Gaussian, logistic, and t responses. Homoscedastic Gaussian
responses are also available in r pkg("truncreg")
.r pkg("frm")
. Beta regression for responses in (0, 1) is in
r pkg("betareg")
and r pkg("gamlss")
.r pkg("survival")
, e.g., Cox proportional hazard models with coxph()
or
Weibull models with survreg()
. Many more refined models can be found in
the r view("Survival")
task view.r pkg("fixest", priority = "core")
, using optimized parallel
C++ code. Other implementations of high-dimensional fixed effects are in
r pkg("lfe")
and r pkg("alpaca")
for linear and generalized linear models,
respectively.r pkg("micEcon")
family of packages: Analysis with
Cobb-Douglas, translog, and quadratic functions is in r pkg("micEcon")
;
the constant elasticity of scale (CES) function is in r pkg("micEconCES")
;
the symmetric normalized quadratic profit (SNQP) function is in
r pkg("micEconSNQP")
. The almost ideal demand system (AIDS) is in
r pkg("micEconAids")
. Stochastic frontier analysis (SFA) is in
r pkg("frontier")
.
Semiparametric SFA in is available in r pkg("semsfa")
and spatial SFA in
r pkg("ssfa")
. The package r pkg("bayesm")
implements a Bayesian approach to microeconometrics and marketing. Inference
for relative distributions is contained in package r pkg("reldist")
.r pkg("ivreg", priority = "core")
, which separates
out the dedicated 2SLS routines previously found in r pkg("AER")
). Another
implementation is available as tsls()
in package r pkg("sem")
.r pkg("ivprobit")
. The r pkg("LARF")
package estimates local average
response functions for binary treatments and binary instruments.r pkg("fixest")
and r pkg("lfe")
for
fixed effects, and r pkg("plm")
for first-difference, between, and multiple
random effects methods.r pkg("REndo")
fits linear models with endogenous
regressor using various latent instrumental variable approaches.
r pkg("SteinIV")
provides semi-parametric IV estimators, including JIVE and
SPS.r view("CausalInference")
task view for related discussions.r pkg("rdrobust")
(offering robust confidence interval construction and
bandwidth selection), r pkg("rddensity")
(density discontinuity testing
(also known as manipulation testing)), r pkg("rdlocrand")
(inference under
local randomization), and r pkg("rdmulti")
(analysis with multiple cutoffs
or scores).r pkg("rdpower")
, while r pkg("RATest")
provides a collection of randomization tests, including a permutation test
for the continuity assumption of the baseline covariates in the sharp RDD.r view("CausalInference")
task view for related discussions.lm()
or glm()
) and only
correct the standard errors. Different types of clustered, panel, and
panel-corrected standard errors are available in r pkg("sandwich")
(incorporating prior work from r pkg("multiwayvcov")
),
r pkg("clusterSEs")
, r pkg("pcse")
, r pkg("clubSandwich")
,
r pkg("plm", priority = "core")
, and r pkg("geepack")
, respectively.
The latter two require estimation of the pooling/independence models via
plm()
and geeglm()
from the respective packages (which also provide
other types of models, see below).r pkg("fixest", priority = "core")
provides very
efficient fixed-effect routines that scale to high-dimensional data and
multiple fixed-effects. r pkg("plm")
, providing a wide range of within,
between, and random-effect methods (among others) along with corrected
standard errors, tests, etc. Various dynamic panel models are
available in r pkg("plm")
, with estimation based on moment conditions in
r pkg("pdynmc")
, and dynamic panel models with fixed effects in
r pkg("OrthoPanels")
. r pkg("feisr")
provides fixed effects individual
slope (FEIS) models. Panel vector autoregressions are implemented in
r pkg("panelvar")
.r pkg("fixest")
supports a variety of GLM-like models in addition to linear panel models.
This includes efficient fixed-effect estimation of logit, probit, Poisson,
and negative binomial models. Similar functionality is provided by
r pkg("alpaca")
(which also accounts for incidental parameter problems)
and r pkg("pglm")
. GEE models for panel data (or longitudinal data in
statistical jargon) are available in in r pkg("geepack")
.r pkg("lme4")
and r pkg("nlme")
.r pkg("fixest")
. See also above.r pkg("pdR")
. The panel data approach method
for program evaluation is available in r pkg("pampe")
. Dedicated fast data
preprocessing for panel data econometrics is provided by r pkg("collapse")
.nls()
in package stats.r pkg("quantreg")
(including linear, nonlinear,
censored, locally polynomial and additive quantile regressions).r pkg("gmm")
.r view("Spatial")
view gives details
about handling spatial data, along with information about (regression)
modeling. In particular, spatial regression models can be fitted using
r pkg("spatialreg")
and r pkg("sphet")
(the latter using a GMM approach).
r pkg("splm")
is a package for spatial panel models. Spatial probit models
are available in r pkg("spatialprobit")
and spatial seemingly unrelated
regression (SUR) models in r pkg("spsur")
.r pkg("BMS")
including flexible prior selection, sampling,
etc. A different implementation is in r pkg("BMA")
for linear models,
generalizable linear models and survival models (Cox regression).r pkg("lavaan")
and r pkg("sem")
.
See also the r view("Psychometrics")
task view for more details.r pkg("grf")
for causal random forests
and estimation of heterogeneous treatment effects, r pkg("DoubleML")
for double machine learning of a wide range of models from the mlr3 family,
and r pkg("hdm")
for selected high-dimensional econometric models.
For a more general overview see the r view("MachineLearning")
task view.r pkg("systemfit")
.r pkg("np")
using kernel smoothing and
r pkg("NNS")
using partial moments.r pkg("nlme")
and
r pkg("lme4")
.r pkg("mgcv")
, r pkg("gam")
,
r pkg("gamlss")
and r pkg("VGAM")
.r pkg("estimatr")
contains fast procedures for
several design-appropriate estimators with robust standard errors and
confidence intervals including linear regression, instrumental variables
regression, difference-in-means, among others.r pkg("ExtremeBounds")
.r pkg("VGAM")
, r pkg("rms")
and
r pkg("Hmisc")
provide several tools for extended handling of
(generalized) linear regression models.r view("TimeSeries")
task view provides much more detailed information
about both basic time series infrastructure and time series models. Here,
only the most important aspects relating to econometrics are briefly
mentioned. Time series models for financial econometrics (e.g., GARCH,
stochastic volatility models, or stochastic differential equations, etc.)
are described in the r view("Finance")
task view."ts"
in
package stats is R's standard class for regularly spaced time series
(especially annual, quarterly, and monthly data). It can be coerced back and
forth without loss of information to "zooreg"
from package r pkg("zoo",
priority = "core")
.r pkg("zoo")
provides infrastructure for both regularly and irregularly spaced time
series (the latter via the class "zoo"
) where the time information can be
of arbitrary class. This includes daily series (typically with "Date"
time
index) or intra-day series (e.g., with "POSIXct"
time index). An extension
based on r pkg("zoo")
geared towards time series with different kinds of
time index is r pkg("xts")
. Further packages aimed particularly at finance
applications are discussed in the r view("Finance")
task view.ar()
and ARIMA modeling and Box-Jenkins-type analysis can
be carried out with arima()
(both in the stats package). An enhanced
version of arima()
is in r pkg("forecast", priority = "core")
.lm()
for
estimating OLS and 2SLS models based on time series data is r pkg("dynlm")
.
Linear regression models with AR error terms via GLS is
possible using gls()
from r pkg("nlme")
.StructTS()
in stats. Further packages are discussed in the
r view("TimeSeries")
task view.decompose()
and HoltWinters()
in stats.
The basic function for computing filters (both rolling and autoregressive)
is filter()
in stats. Many extensions to these methods, in particular for
forecasting and model selection, are provided in the r pkg("forecast")
package.ar()
in stats,
more elaborate models are provided in package r pkg("vars")
along with
suitable diagnostics, visualizations etc. Panel vector autoregressions are
available in r pkg("panelvar")
.r pkg("urca", priority = "core")
,
r pkg("tseries", priority = "core")
, r pkg("CADFtest")
. See also
r pkg("pco")
for panel cointegration tests and
r pkg("plm", priority = "core")
for panel unit root tests.r pkg("tsDyn")
- Threshold and smooth transition models.r pkg("midasr")
- MIDAS regression and other econometric methods for
mixed frequency time series data analysis.r pkg("gets")
- GEneral-To-Specific (GETS) model selection for either
ARX models with log-ARCH-X errors, or a log-ARCH-X model of the log
variance.r pkg("bimets")
- Econometric modeling of time series data using
flexible specifications of simultaneous equation models.r pkg("dlsem")
- Distributed-lag linear structural equation models.r pkg("lpirfs")
- Local projections impulse response functions.r pkg("apt")
- Asymmetric price transmission models.r pkg("AER")
, r pkg("Ecdat")
, and
r pkg("wooldridge")
contain a comprehensive collections of data sets from
various standard econometric textbooks (including Greene, Stock & Watson,
Wooldridge, Baltagi, among others) as well as several data sets from the
Journal of Applied Econometrics and the Journal of Business & Economic
Statistics data archives. r pkg("AER")
and r pkg("wooldridge")
additionally provide extensive sets of examples reproducing analyses from
the textbooks/papers, illustrating various econometric methods. In
r pkg("pder")
a wide collection of data sets for "Panel Data Econometrics
with R" (Croissant & Millo 2018) is available. The
r github("ccolonescu/PoEdata")
package on GitHub provides the data sets from
"Principles of Econometrics" (4th ed, by Hill, Griffiths, and Lim 2011).r pkg("CDNmoney")
.r pkg("pwt")
provides versions 5.6, 6.x, 7.x. Version
8.x and 9.x data are available in r pkg("pwt8")
and r pkg("pwt9")
,
respectively.r pkg("expsmooth")
,
r pkg("fma")
, and r pkg("Mcomp")
are data packages with time series data
from the books "Forecasting with Exponential Smoothing: The State Space
Approach" (Hyndman, Koehler, Ord, Snyder, 2008, Springer) and
"Forecasting: Methods and Applications" (Makridakis, Wheelwright, Hyndman,
3rd ed., 1998, Wiley) and the M-competitions, respectively.r pkg("erer")
contains
functions and datasets for the book of "Empirical Research in Economics:
Growing up with R" (Sun 2015).r pkg("psidR")
can build panel
data sets from the Panel Study of Income Dynamics (PSID).r pkg("wbstats")
package provides
programmatic access to the World Bank API.r pkg("modelsummary")
. Other
implementations as well as further utilities for integrating econometric
and statistical results in scientific papers etc. are discussed in the
r view("ReproducibleResearch")
task view.r pkg("Matrix")
and r pkg("SparseM")
.r view("Optimization")
task view.r pkg("boot")
package, there
are some other general bootstrapping techniques available in
r pkg("bootstrap")
or r pkg("simpleboot")
as well some bootstrap techniques
designed for time-series data, such as the maximum entropy bootstrap in
r pkg("meboot")
or the tsbootstrap()
from r pkg("tseries")
.
The r pkg("fwildclusterboot")
package provides a fast wild cluster
bootstrap implementation for linear regression models, especially when
the number of clusters is low.r pkg("ineq")
provides some basic tools such as Lorenz curves,
Pen's parade, the Gini coefficient, Herfindahl-Hirschman index and many more.r pkg("strucchange")
and r pkg("segmented")
.r pkg("fxregime")
.r pkg("gvc")
and r pkg("decompr")
.r pkg("rdd")
, r pkg("rdrobust")
, and r pkg("rdlocrand")
packages. The
r pkg("rdpower")
package offers power calculations for regression
discontinuity designs. And r pkg("rdmulti")
implements analysis with
multiple cutoffs or scores.r pkg("gravity")
.r pkg("zTree")
can import data from the z-Tree software for
developing and carrying out economic experiments.r pkg("nse")
implements various numerical
standard errors for time series data, especially in simulation experiments
with correlated outcome sequences.Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.