Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# st: xtdpd two-step robust estimates

 From Daniel Borowczyk Martins To statalist@hsphsun2.harvard.edu Subject st: xtdpd two-step robust estimates Date Thu, 29 Jul 2010 11:54:11 +0100

```Dear Stata users,

I am experiencing a problem with xtdpd. Maybe you're familiar with
this problem and can help me solve it.

Basically, I cannot mimic some of the estimations I do using xtabond2.
In particular, xtdpd reports an error (estimates post: matrix has
missing values) when I choose options  robust standard errors,
twostep, or both.

1. I start by implemeting a one-step difference GMM procedure using
both commands. The results are almost the same.

xtdpd md_jfr md_omg, dg(md_omg, l(2 6)) nocons

Dynamic panel-data estimation                Number of obs         =     12854
Group variable: i                            Number of groups      =       275
Time variable: t
Obs per group:    min =        19
avg =  46.74182
max =        47

Number of instruments =    220               Wald chi2(1)          =     32.94
Prob > chi2           =    0.0000
One-step results

md_jfr       Coef.   Std. Err.      z    P>z     [95% Conf. Interval]

md_omg    .0342955   .0059756     5.74   0.000     .0225835    .0460075

Instruments for differenced equation
GMM-type: L(2/6).md_omg

xtabond2 md_jfr omg_md, gmm(md_omg, l(2 6)) noleveleq

Dynamic panel-data estimation, one-step difference GMM

Group variable: i                               Number of obs      =     12852
Time variable : t                               Number of groups   =       275
Number of instruments = 220                     Obs per group: min =        19
Wald chi2(1)  =     32.50                                      avg =     46.73
Prob > chi2   =     0.000                                      max =        47

md_jfr       Coef.   Std. Err.      z    P>z     [95% Conf. Interval]

md_omg    .0340472   .0059719     5.70   0.000     .0223424    .0457519

Instruments for first differences equation
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(2/6).md_omg

Arellano-Bond test for AR(1) in first differences: z = -40.63  Pr > z =  0.000
Arellano-Bond test for AR(2) in first differences: z =  -1.86  Pr > z =  0.062

Sargan test of overid. restrictions: chi2(219)  =1084.45  Prob > chi2 =  0.000
(Not robust, but not weakened by many instruments.)

2. Now if I ask for robust standard errors, xtabond2 completes the
task with no problem, but xtdpd reports the error above.

xtabond2 md_jfr omg_md, gmm(md_omg, l(2 6)) noleveleq robust

Favoring space over speed. To switch, type or click on mata: mata set
matafavor       speed,  perm.

Dynamic panel-data estimation, one-step difference GMM

Group variable: i                               Number of obs      =     12852
Time variable : t                               Number of groups   =       275
Number of instruments = 220                     Obs per group: min =        19
Wald chi2(1)  =      5.27                                      avg =     46.73
Prob > chi2   =     0.022                                      max =        47

Robust
md_jfr       Coef.   Std. Err.      z    P>z     [95% Conf. Interval]

md_omg    .0340472    .014833     2.30   0.022      .004975    .0631193

Instruments for first differences equation
GMM-type (missing=0, separate instruments for each period unless collapsed)
L(2/6).md_omg

Arellano-Bond test for AR(1) in first differences: z =  -6.52  Pr > z =  0.000
Arellano-Bond test for AR(2) in first differences: z =  -0.98  Pr > z =  0.329

Sargan test of overid. restrictions: chi2(219)  =1084.45  Prob > chi2 =  0.000
(Not robust, but not weakened by many instruments.)
Hansen test of overid. restrictions: chi2(219)  = 242.76  Prob > chi2 =  0.130
(Robust, but can be weakened by many instruments.)

xtdpd md_jfr md_omg, dg(md_omg, l(2 6)) nocons vce(robust)

estimates post: matrix has missing values
r(504);

3. The same problem occurs if I ask xtdpd for twostep and twostep and
robust standard errors.

4. I tried to assess whether the error might be related with the
number of instruments and/or the covariance matrix of moments being
singular. This because when that is the case, xtabond2 uses a
generalized inverse to calculate optimal weighting matrix for two-step
estimation. My analysis suggests this is not where the problem lies.

Do you have an idea of what's going on and how I can implement twostep
and robust ses options using xtdpd?

Cheers,
Daniel

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```