Solution (source code)

= Solution

The second <logistic regression> adds $\gamma_2Y_{i,t-2}$ while retaining the first lag and baseline <covariates>. The models are nested under $H_0:\gamma_2=0$. Their <likelihood-ratio test statistic> is the reduction in <binomial deviance>,
$$
\boxed{2(\widehat\ell_2-\widehat\ell_1)=1164.4-1155.0=9.4.}
$$
Under the null and regular large-sample conditions for the correctly specified conditional <likelihood>, this has an approximate <chi-squared distribution> with one <statistical degree of freedom>. Since $9.4>3.841$, reject at 5%; the approximate <p-value> is $0.0022$. \b[Prefer the two-lag model to the one-lag model.] Its additional lag captures statistically useful information in the history.