Applied Econometrics With R
Applied Econometrics With R
Christian Kleiber Achim Zeileis Example: Sandwich variance estimators for a tobit model
Universität Basel Wirtschaftsuniversität Wien
Switzerland Austria • Gaps
1.0
1.0
• Language and terminology in econometrics is somewhat distinct from the terminol-
0.8
0.8
no
ogy used in mainstream statistics.
no
participation
participation
0.6
0.6
Two examples:
0.4
0.4
Statistics Econometrics
yes
0.2
0.2
yes
generalized linear model probit, logit, ...
0.0
0.0
• Generally, not much awareness of statistical GLM literature among econometricians. 0 6 8 10 12 2 3 3.5 4 4.5 5 6
education age
• Visualization not very common.
• Diagnostics and validation: Robust regression, sandwich covariance matrices, In the linear regression model
diagnostic tests
• Microeconometrics: Logit, Probit, Poisson regression (via glm()), Tobit, modi- yi = x>
i β + εi ,
fied count data models (ZIP, hurdle), duration models (package survival)
we have for OLS, under technical assumptions,
• Time series: (S)ARIMA(X), unit roots and cointegration (packages tseries,
urca), structural change, ARCH models (see Rmetrics), structural time series √ d
models n(β̂ − β) −→ N (0, σ 2Q−1
XX )
See also CRAN task view: econometrics at provided model is correctly specified.
http://CRAN.R-project.org/src/contrib/Views/Econometrics.html
In econometrics usually called “White standard errors” or “heteroskedasticity-consistent • Cross-section data on frequency of extramarital affairs from a survey conducted by
(HC) standard errors”. Psychology Today in 1969.
Depending on the context, this is also known as Eicker-White, Huber-White, Eicker- • n = 601, dependent variable is number of extramarital affairs, covariates are gender,
Huber-White ... age, years married, children, religiousness, education, occupation, rating of marriage.
The matrix Σv = Cov(vi) = Cov(xiεi) = E(ε2i xix> i ) comes from an estimating • 75.04% of the respondents do not report any extramarital affairs.
equation. Idea generalizes to GLMs and many other models.
R provides infrastructure for HC (and also HAC) covariances in the sandwich package. Data will be available in package AER.
• dynamic regressions (but see packages dyn and dynlm) Christian Kleiber and Achim Zeileis: Applied Econometrics with R, Springer-Verlag,
• multiple time series models (structural VARs, ...) New York, 2006 (?)
• nonlinear time series models (TAR, smooth transition models, ...) Contents:
• panel data methods, in particular
• R Basics
– least-squares methods • Linear Regression and Extensions
– dynamic models • Validating Linear Models
– microeconometric models (GLMs with panel data, ...)
• Models of Microeconometrics
• GMM and instrumental variables • Time Series Models
• non- and semiparametric regression • Programming Your Own Analysis
Be sure to attend
Package AER contains more than 60 data sets (with examples) from
• textbooks
– B. Baltagi: Econometrics, 3e
Econometrics and Social Science
– W.H. Greene: Econometric Analysis, 5e
– P.H. Franses: Time Series Models for Business and Economic Forecasting (Spotlights: HS 0.3, Forum: Aula 3)
• data archives of the Journal of Applied Econometrics, Journal of Business and Eco- Friday 16 15:00-18:30
nomic Statistics