# Panel vs 2-pass regression

Consider the following data generating process. For simplicity, assume all quantities are scalars with $$Y_{it}$$, $$X_{it}$$ and $$G_i$$ observable for all $$i\in \{1..N\}$$ and $$t\in \{1..T\}$$ where $$N\gg T$$ (but lets assume away dynamic panel bias). Denote the process as:

\begin{align} Y_{it} &=a_i+\beta_i(G_i) X_{it-1}+\varepsilon_{it}\\ &s.t.\\ \beta_i(G_i) &= \delta+\gamma G_i+\eta_i\\ &and\\ E_i[X_{it}\varepsilon_{it}] &=0\;\forall\; i\in \{1...N\}\\ E[G_{i}\eta_{i}] &= 0 \end{align}

To estimate the model, I run the first regression for all i using OLS and then use the estimated coefficients to run the second regression.

My question is as follows: Is there a single-pass OLS panel-regression equivalent of the above two pass procedure? If so, what is it? If not, is there a general classification of these types of problems so I can do further research?

My initial instinct was to run the following regression: \begin{align} Y_{it} &=a_i+\gamma G_i X_{it-1}+\delta X_{it-1}+\epsilon_{it} \end{align} but this didn't seem to reproduce the same coefficients (it's possible I have a coding error, or some wonky issues with missing data, but I've been working with it long enough that I'm starting to doubt that).

As far as the standard errors on $$\gamma$$ goes, I was thinking a GMM or block-bootstrap approach might make sense.