sergiocorreia / ppmlhdfe

Poisson pseudo-likelihood regression with multiple levels of fixed effects

Home Page:http://scorreia.com/software/ppmlhdfe/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does pplphdfe use the same sample size as poisson?

DF-18 opened this issue · comments

commented

Dear Sergio,

I checked the results of command pplphdfe and poisson in Stata, and ran codes as below:

sysuse auto, clear
ppmlhdfe price weight, a(turn)
poisson price weight i.turn,vce(robust)

The observations reported are different with each other.

. ppmlhdfe price weight, a(turn)
(dropped 4 observations that are either singletons or separated by a fixed effect)
Iteration 1: deviance = 2.7681e+04 eps = . iters = 1 tol = 1.0e-04 min(eta) =

0.12 P
Iteration 2: deviance = 2.7317e+04 eps = 1.33e-02 iters = 1 tol = 1.0e-04 min(eta) =
0.09
Iteration 3: deviance = 2.7317e+04 eps = 7.90e-06 iters = 1 tol = 1.0e-04 min(eta) =
0.09
Iteration 4: deviance = 2.7317e+04 eps = 8.09e-12 iters = 1 tol = 1.0e-05 min(eta) =
0.09
Iteration 5: deviance = 2.7317e+04 eps = 1.91e-16 iters = 1 tol = 1.0e-07 min(eta) =
0.09 S O



(legend: p: exact partial-out s: exact solver h: step-halving o: epsilon below tolerance)
Converged in 5 iterations and 5 HDFE sub-iterations (tol = 1.0e-08)

HDFE PPML regression No. of obs = 70
Absorbing 1 HDFE group Residual df = 55
Wald chi2(1) = 71.89
Deviance = 27316.76429 Prob > chi2 = 0.0000
Log pseudolikelihood = -14025.19017 Pseudo R2 = 0.6592

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

-------------+----------------------------------------------------------------
weight | .0007682 .0000906 8.48 0.000 .0005906 .0009457
_cons | 6.33763 .2750445 23.04 0.000 5.798553 6.876707

. poisson price weight i.turn,vce(robust)

Iteration 0: log pseudolikelihood = -14047.47
Iteration 1: log pseudolikelihood = -14046.088
Iteration 2: log pseudolikelihood = -14046.088

Poisson regression Number of obs = 74
Wald chi2(14) = .
Prob > chi2 = .
Log pseudolikelihood = -14046.088 Pseudo R2 = 0.6807


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

-------------+----------------------------------------------------------------
weight | .0007682 .0000906 8.48 0.000 .0005907 .0009457

As u can see, the observations reported are different with each other, although the "weight" coefficient and standard error are the same. Does this mean pplphdfe use the same sample size as poisson? i.e. Although the observations in Poisson are 74, it actually use 70 of 74 observations to estimate coefficient and standard errors?

What I want to say is that if two estimations use different sample, it is unlikely that they could get the same result of coefficient and standard errors, right? Is it true that, in both regressions, there are 4 observations being omitted as a result of i.turn(fixed effect) included in the regression? Thanks.

Hi,

In this case, the four obs. that ppmlhdfe is dropping correspond to turn=31,32,39,51 , all of which appear only once. Here, because these dummies are one only in one observation (a "singleton"), they perfectly explain the LHS in this observation. Thus, ppmlhdfe (and reghdfe) drop the four observations, for these three reasons:

  1. They slow down estimation (more obs = slower)
  2. They contribute no information that can be used to estimate the coefficients of interest (the coef of weight in this case)
  3. They artificially increase the degrees-of-freedom, because these four obs. provided no information they don't improve at all the accuracy of the estimation of the coefficient for weight.

Also, note that the standard errors are indeed different:

sysuse auto
qui ppmlhdfe price weight, a(turn)
di %12.8f _se[weight]
qui poisson price weight i.turn , vce(robust)
di %12.8f _se[weight]

Lastly, if you use the undocumented keepsingletons option, both estimators will coincide:

ppmlhdfe price weight, a(turn) keepsingletons

Best,
Sergio

commented

Thanks u very much Sergio. It's helpful to understand this command.