pdynmc-pres-in-a-nutshell
pdynmc-pres-in-a-nutshell
pdynmc-pres-in-a-nutshell
1 Introduction
2 GMM estimation
5 Conclusion
2 / 22
What is pdynmc?
pdynmc → panel data
pdynmc → (linear) dynamic models ⇒ GMM
pdynmc → (linear and/or) nonlinear moment conditions (w.r.t. αj , βk )
yi ,t = α1 yi ,t −1 + . . . + αp yi ,t −p
+ β1 xi∗,t ∗ ,1 + . . . + βq xi∗,t ∗ ,q + ηi + εi ,t
| {z }
ui ,t
where
x ∗ means that we allow for endogenous, predetermined, and/or
exogenous covariates (could also be time/etc. dummies), and
t ∗ means that arbitrary lags of the covariates can be included.
3 / 22
Key features of pdynmc (and conclusion)
pdynmc allows for GMM estimation of linear dynamic panel data models
based on linear and/or nonlinear moment conditions and provides the
following features:
4 / 22
GMM estimation, moment conditions, assumptions
L = m0 · W · m
where
m is the sample analogon to the population moment conditions E (·),
W is the (moment condition) weighting matrix.
The moment conditions are derived from different (sets of) assumptions.
5 / 22
Sets of assumptions
E (∆yi ,t · ηi ) = 0, i = 1, . . . , n.
6 / 22
Moment conditions are derived w.r.t.
Equation in levels
yi ,t = α1 yi ,t −1 + . . . + αp yi ,t −p
+ β1 xi∗,t ∗ ,1 + . . . + βq xi∗,t ∗ ,q + ηi + εi ,t
| {z }
ui ,t
7 / 22
Standard moment conditions
under A1
Linear moment conditions w.r.t. equation in differences
under A1 & A2
Linear moment conditions w.r.t. equation in levels
E (∆yi ,t −1 · ui ,t ) = 0, t = 3, . . . , T . (MYL)
8 / 22
Moment conditions from covariates
Linear moment conditions w.r.t. equation in differences
T
!
X
E ∆xit ∆uit =0 for exogenous x . (MFCD)
t =2
. . . linear moment conditions derived from A1 fail to identify the lag parameter.
10 / 22
Installing and loading package
install.packages("pdynmc")
install.packages("devtools")
library(devtools)
install_github("markusfritsch/pdynmc")
library(pdynmc)
11 / 22
Load and adjust example data set
12 / 22
Function data.info
data.info(
dat,
i.name = "firm",
t.name = "year"
)
yields
13 / 22
Function strucUPD.plot
strucUPD.plot(
dat,
i.name = "firm",
t.name = "year"
)
140
Ti
yields 9
8
120
7
100
80
firm
60
40
20
year
14 / 22
Function pdynmc
reg <- pdynmc(
dat = dat, varname.i = "firm", varname.t = "year",
include.y = TRUE,
varname.y = "n", lagTerms.y = 2,
fur.con = TRUE,
fur.con.diff = TRUE, fur.con.lev = TRUE,
varname.reg.fur = c("w", "k", "ys"),
lagTerms.reg.fur = c(1,2,2),
include.dum = TRUE,
dum.diff = TRUE, dum.lev = FALSE,
varname.dum = "year",
summary(reg)
yields . . .
15 / 22
Model output for object reg (excerpt)
Dynamic linear panel estimation (iterative)
Estimation steps: 13
Coefficients:
Estimate Std.Err.rob z-value.rob Pr(>|z.rob|)
L1.n 1.19704 0.06855 17.463 < 2e-16 ***
L2.n -0.12589 0.06799 -1.852 0.06403 .
L0.w -0.21935 0.12697 -1.728 0.08399 .
L1.w 0.25791 0.13753 1.875 0.06079 .
L0.k 0.25521 0.05568 4.583 < 2e-16 ***
L1.k -0.15546 0.07673 -2.026 0.04276 *
L2.k -0.15599 0.05498 -2.837 0.00455 **
L0.ys 0.53006 0.18336 2.891 0.00384 **
L1.ys -0.37925 0.22256 -1.704 0.08838 .
L2.ys -0.20770 0.15186 -1.368 0.17131
1979 0.03124 0.01015 3.077 0.00209 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
yields
coef. est.
coef. initial
1.0
coef. range
0.5
Estimate
0.0
−0.5
L1.n L2.n L0.w L1.w L0.k L1.k L2.k L0.ys L1.ys L2.ys
17 / 22
Coefficient path plot (Hansen & Lee, 2020)
plot(reg, type = "coef.path", omit1step = TRUE,
co = c("L1.n", "L2.n", "L0.w", "L1.w")
)
L1.n
L2.n
L0.w
1.0
L1.w
Estimate
0.5
0.0
−0.5
1 2 3 4 5 6 7 8 9 10 11 12 13
Iteration
18 / 22
Arguments of function pdynmc (1)
19 / 22
Arguments of function pdynmc (2)
20 / 22
Arguments of function pdynmc (3)
Context R-command
Basic configuration w.mat
std.err
estimation
Handle multicollinearity col_tol
inst.thresh
Stata-conformity inst.stata
w.mat.stata
Iterated estimation max.iter
iter.tol
Nonlinear optimization opt.method
hessian
optCtrl
Starting values custom.start.val
start.val
start.val.lo
start.val.hi
seed.input
21 / 22
References
Ahn, S. C. & P. Schmidt (1995), Efficient estimation of models for dynamic panel data.
Journal of Econometrics, 68(1), 5–27.
Arellano, M. & S. Bond (1991), Some Tests of Specification for Panel Data: Monte
Carlo Evidence and an Application to Employment Equations. Review of Economic
Studies 58, 277–297.
Fritsch, M., Pua, A. & J. Schnurbus (2020), pdynmc - An package for estimating linear
dynamic panel data models based on nonlinear moment conditions, Working Paper.
Hansen, B. E. & S. Lee (2020), Inference for Iterated GMM Under Misspecification,
Econometrica, forthcoming.