Count2019 DAY1b Crosssection Inference
Count2019 DAY1b Crosssection Inference
A. Colin Cameron
Univ. of Calif. - Davis
. .
Nonlinear Cross-section and Panel Regression
Models for Count Data
. .
Queens University, Canada
Department of Economics
1. Introduction
Outline
1 Introduction
2 Standard Errors for OLS
3 Standard Errors for Poisson
4 Bootstrap
5 Bootstrap with Asymptotic Re…nement
b = (∑i xi x0 ) 1
First consider OLS in linear model: β i ∑i xi yi .
Substitute in yi = xi0 β + ui and simplify gives
1
b
β β= ∑i xi xi0 ∑i xi ui .
For simplicity assume that the xi0 s are …xed
I b ] = β.
if E[ui ] = 0 then E[ β
I it follows that then
b]
V[ β = b
E[( β β )2 ]
1 h i 1
= ∑i xi xi0 V ∑i xi ui ∑i xi xi0 .
Original approach: Assume a model for E[ui2 jxi ] and …t this model
I b [xi x0 u 2 ] = xi x0 exp(x0 b
e.g. E[ui2 ] = exp(xi0 α) and use E i i i i α)
1980’s on: There is no need for such a model!
I simply estimate ∑ E[x x0 u 2 ] by ∑ x x0 u
i i i i
2
i i i bi where u
bi = yi b
xi0 β.
I even though ubi is not a good estimate of E[ui2 ]
2
I heteroskedastic-robust due to White (1982) and Huber (1967)
1 h i 1
V b ] = ∑ xi x0
b [β ∑i i i i
x x 0 2
b
u ∑i xi xi0
i i
Can extend to
I serially correlated errors (HAC robust)
I clustered errors (cluster-robust).
A. Colin Cameron Univ. of Calif. - Davis . . Nonlinear
Counts:
Cross-section
Cross-section
andInference
Panel Regression Models for May
Count13-16,
Data 2019
. . Queens5 Univers
/ 29
3. Standard Errors for Poisson quasi-MLE
∑ i ( yi b ))xi '
exp(xi0 β ∑i (yi exp(xi0 β))xi ∑i exp(xi0 β)xi xi0 ( βb β)
∑i (yi µi )xi + ∑i b
µi xi xi0 ( β β) ' 0.
b
Solve for ( β β)
1
b
(β β) ' ∑i µi xi xi0 ∑i (yi µi )xi .
b 1
This is like earlier OLS ( β β) = (∑i xi xi0 ) ∑i xi ui
I so proceed in the same way.
A. Colin Cameron Univ. of Calif. - Davis . . Nonlinear
Counts:
Cross-section
Cross-section
andInference
Panel Regression Models for May
Count13-16,
Data 2019
. . Queens6 Univers
/ 29
3. Standard Errors for Poisson quasi-MLE
Then
1 h i 1
b] '
V[ β ∑i µi xi xi0 V ∑i (yi µi )xi ∑i µi xi xi0 .
And we use
1 h i 1
V b] =
b HET [ β ∑i µi xi xi0 ∑i (yi bi )2 xi xi0
µ ∑i µi xi xi0 .
∑g =1 ∑i 2g ∑j 2g E[(yi
G
= µi )xi (yj µj )xj0 ] .
Robust
docvis Coef. Std. Err. z P>|z| [95% Conf. Interval]
Sorted by:
. summarize
legend: b/se
Implementation
Number of bootstraps: B high is best but increases computer time.
I CT use 400 for se’s and 999 for tests and con…dence intervals.
I Defaults are often too low. And set the seed!
Various resampling methods
I 1. Paired (or nonparametric or empirical dist. func.) is most common
F w1 , ..., wN obtained by sampling with replacement from w1 , ..., wN .
I 2. Parametric bootstrap for fully parametric models.
F Suppose y jx F (x, θ0 ) and generate yi by draws from F (xi , b
θ)
I 3. Residual bootstrap for regression with additive errors
F Resample …tted residuals u b1 , ..., u
bN to get (u
b1 , ..., u
bN ) and form new
(y1 , x1 ), ..., (yN , xN ).
Need to resample over i.i.d. observations
I resample over clusters if data are clustered
F But be careful if model includes cluster-speci…c …xed e¤ects.
I resample over moving blocks if data are serially correlated.
A. Colin Cameron Univ. of Calif. - Davis . . Nonlinear
Counts:
Cross-section
Cross-section
andInference
Panel Regression Models forMay
Count
13-16,
Data2019
. . Queens
16 Univers
/ 29
4. Bootstrap Estimate of standard error Bootstraps can fail
Bootstrap failure
Jackknife
∑i =1 (bθ (
N
b [b
V θ] = N 1
N i)
b
θ )2 , where b
θ=N 1
∑i bθ( i ).
I where b
θ( i) is b
θ obtained from the sample with observation i omitted.
The jackknife is a “rough and ready” method for bias reduction in
many situations, but not the ideal method in any.
I it can be viewed as a linear approximation of the bootstrap (Efron and
Tibsharani (1993, p.146)).
I it requires less computation than the bootstrap in small samples, as
then N < B is likely
I but is outperformed by the bootstrap as B ! ∞.
Clustered data
∑g =1 (bθ ( ∑g bθ(
G
b [b
V θ] = G 1
g)
b
θ )2 , where b
θ=G 1
g ).
G
Observed Bootstrap
docvis Coef. Bias Std. Err. [95% Conf. Interval]
Percentile-t bootstrap
.
. * Percentile-t for a single coefficient: Bootstrap the t statistic
. use bootdata.dta, clear
a
Bootstrap t = (b
θ θ 0 )/sbθ N [0, 1]
The 999 tstar values are the bootstrap estimated density of the t-statistic
A. Colin Cameron Univ. of Calif. - Davis . . Nonlinear
Counts:
Cross-section
Cross-section
andInference
Panel Regression Models forMay
Count
13-16,
Data2019
. . Queens
24 Univers
/ 29
5. Bootstrap with asymptotic re…nement Percentile-t bootstrap
-5 0 5
tstar
. summarize
Binom. Interp.
Variable Obs Percentile Centile [95% Conf. Interval]
Wild bootstrap
I b (b ) = β
β b+H
b 1
∑ni=1 gi .
(b )