29.07.2014 Views

xtlogit - Stata

xtlogit - Stata

xtlogit - Stata

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16 <strong>xtlogit</strong> — Fixed-effects, random-effects, and population-averaged logit models<br />

L ≈<br />

n∑<br />

i=1<br />

[<br />

∑<br />

M<br />

w i log<br />

√2̂σi<br />

m=1<br />

∏n i<br />

t=1<br />

wm ∗ exp { (a ∗ m) 2}exp{ −( √ }<br />

2̂σ i a ∗ m + ̂µ i ) 2 /2σν<br />

2 √<br />

2πσν<br />

F (y it , x it β + √ ]<br />

2̂σ i a ∗ m + ̂µ i )<br />

where w i is the user-specified weight for panel i; if no weights are specified, w i = 1.<br />

The default method of adaptive Gauss–Hermite quadrature is to calculate the posterior mean and<br />

variance and use those parameters for ̂µ i and ̂σ i by following the method of Naylor and Smith (1982),<br />

further discussed in Skrondal and Rabe-Hesketh (2004). We start with ̂σ i,0 = 1 and ̂µ i,0 = 0, and<br />

the posterior means and variances are updated in the kth iteration. That is, at the kth iteration of the<br />

optimization for l i , we use<br />

Letting<br />

l i,k ≈<br />

M∑ √<br />

2̂σi,k−1 wm ∗ exp { a ∗ m) 2} g(y it , x it , √ 2̂σ i,k−1 a ∗ m + ̂µ i,k−1 )<br />

m=1<br />

τ i,m,k−1 = √ 2̂σ i,k−1 a ∗ m + ̂µ i,k−1<br />

and<br />

̂σ i,k =<br />

̂µ i,k =<br />

√ M∑<br />

2̂σi,k−1 wm ∗ exp { (a ∗<br />

(τ i,m,k−1 )<br />

m) 2} g(y it , x it , τ i,m,k−1 )<br />

m=1<br />

√ M∑<br />

(τ i,m,k−1 ) 2 2̂σi,k−1 wm ∗ exp { (a ∗ m) 2} g(y it , x it , τ i,m,k−1 )<br />

− (̂µ i,k ) 2<br />

l i,k<br />

m=1<br />

and this is repeated until ̂µ i,k and ̂σ i,k have converged for this iteration of the maximization algorithm.<br />

This adaptation is applied on every iteration until the log-likelihood change from the preceding iteration<br />

is less than a relative difference of 1e–6; after this, the quadrature parameters are fixed.<br />

The log likelihood can also be calculated by nonadaptive Gauss–Hermite quadrature, the intmethod(ghermite)<br />

option, where ρ = σ 2 ν/(σ 2 ν + 1):<br />

L =<br />

≈<br />

n∑<br />

i=1<br />

l i,k<br />

{<br />

}<br />

w i log Pr(y i1 , . . . , y ini |x i1 , . . . , x ini )<br />

[<br />

n∑ 1<br />

w i log √ π<br />

i=1<br />

∑<br />

M n i<br />

wm<br />

∗<br />

m=1 t=1<br />

{<br />

∏<br />

F y it , x it β + a ∗ m<br />

( ) }] 1/2 2ρ<br />

1 − ρ<br />

Both quadrature formulas require that the integrated function be well approximated by a polynomial<br />

of degree equal to the number of quadrature points. The number of periods (panel size) can affect<br />

whether<br />

∏n i<br />

F (y it , x it β + ν i )<br />

t=1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!