Dear Robert, dear list,
an update following a short discussion with the maintainer:
the way to estimate an 'fd' model without intercept in plm() is the same
as in lm() etc., i.e. using one of the (equivalent) following formula
notations
y~x+0
y~x-1
so the syntax in your second example is correct and should work.
In fact it seems to be working fine unless there is only one regressor, as
in your example. This is a bug, probably stemming from some (nxk) matrix
degenerating into a vector as k=1 (maybe the most common bug ever in R?).
A bug fix should appear soon; in the meantime, my observation on
consistency of the estimates of the model with intercept still applies. I
take this chance to report an observation Yves just made, on which I
totally agree: estimating the intercept can be a useful diagnostic, as if
it turns out significant this indicates some specification problem (the
difference of the intercept is nonzero=> the "true" intercept is not
constant, but somehow time-varying). You can get an example by estimating
(a simplified version of-) the Arellano and Bond model:
data("EmplUK", package="plm")
myfdmod <-
plm(log(emp)~log(wage)+log(capital)+log(output),data=EmplUK,model="fd")
and looking at the summary().
Best wishes,
Giovanni
Giovanni Millo
Research Dept.,
Assicurazioni Generali SpA
Via Machiavelli 4,
34132 Trieste (Italy)
tel. +39 040 671184
fax +39 040 671160
-----Messaggio originale-----
Da: Millo Giovanni
Inviato: marted? 14 aprile 2009 16:26
A: 'Robert Iquiapaza'; r-sig-finance at stat.math.ethz.ch
Cc: Yves Croissant
Oggetto: R: [R-SIG-Finance] No intercep for First-Difference Estimator in
PLM(panel data)
Dear Robert,
in fact this should be automatic, at least at first sight, as the
intercept term should be differenced out. Yet there are cases where you
would want to retain it (see, e.g., Example 10.6 in Wooldridge,
Econometric Analysis of cross-section and panel data).
We'll look into the formula specification. For now, let me just observe
that it doesn't do any harm to include the intercept anyway, as by
definition it is uncorrelated with the errors and the other regressors, so
your betas keep consistent if they were in the first place.
Best wishes,
Giovanni
PS please put at least one of the authors in c/c next time
Giovanni Millo
Research Dept.,
Assicurazioni Generali SpA
Via Machiavelli 4,
34132 Trieste (Italy)
tel. +39 040 671184
fax +39 040 671160
-----Messaggio originale-----
Da: Robert Iquiapaza [mailto:rbali at ufmg.br]
Inviato: luned? 13 aprile 2009 05:28
A: r-sig-finance at stat.math.ethz.ch
Oggetto: [R-SIG-Finance] No intercep for First-Difference Estimator in
PLM(panel data)
Hi
I want to estimate a FD model using plm, but with no intercept. It seems
that plm ignores "intercept = FALSE".
And adding "+0" to the function produce an error.
#First-Difference Estimator
wag.fd1 <- plm(wage ~ marr, intercept = FALSE, data = wage2, model = "fd")
wag.fd2 <- plm(wage ~ marr+0, data = wage2, model = "fd")
wag.fd2 <- plm(wage ~ marr+0, data = wage2, model = "fd")
Error in result[is.na(cond), ] <- NA :
(subscript) logic subscript too long
My data looks like:
id time wage marr time1
1 1 1 1000 0 1
2 1 2 1050 0 2
3 1 3 950 0 3
4 1 4 1000 0 4
5 1 5 1100 0 5
6 1 6 900 0 6
7 2 1 2000 0 1
8 2 2 1950 0 2
9 2 3 2000 0 3
10 2 4 2000 0 4
11 2 5 1950 0 5
12 2 6 2100 0 6
13 3 1 2900 0 1
14 3 2 3000 0 2
15 3 3 3100 0 3
16 3 4 3500 1 4
17 3 5 3450 1 5
18 3 6 3550 1 6
19 4 1 3950 0 1
20 4 2 4050 0 2
21 4 3 4000 0 3
22 4 4 4500 1 4
23 4 5 4600 1 5
24 4 6 4400 1 6
I would appreciate if anyone knows how to specify no intercept for first
difference model in panel data using plm?
Thank you
Robert