I want to run a non-linear two-stage least squares regression, but it appears there is no preexisting package. I have a plan, but I want to see whether someone can suggest a better way.
I have a panel dataset, but for simplicity, I refer to all observations by t, and drop the i.
I have reason to believe that Y grows exponentially from one period to the next. However, although Y is usually positive, it is sometimes negative. So a log-linear regression is not feasible. Therefore, I am estimating a linear-exponential regression.
So Yt = B0 + B1*Yt-1 + (B2)^(Yt-1) + various covariates + et
Thus, I use the nl command to estimate this non-linear equation.
However, including a lagged dependent variable creates endogeneity bias. There are two options: (1) the Anderson-Hsiao estimator, FD IV, i.e. first-differences with lags of Y being instruments for Y, and (2) GMM.
I cannot use the xtivreg command to perform FD IV because my equation is non-linear.
So my plan is this:
(1) Use the nl command to perform the first-stage regression, i.e. regress Yt on appropriate lags of itself - including the term (B2)^(Yt-1) - and any other instruments. Save the predicted values of Yt. Manually calculate statistics such as the Sargan, etc.
(2) Use the nl command to perform the second-stage regression using the predicted values of Yt-1.
(3) Wrap #1 and #2 together in a bootstrapped program.
Any suggestions for a better way than that?
I do have an alternative measure of Y that is strictly positive. This alternative measure is theoretically less sound than my preferred measure. But it has the advantage of being strictly positive, so I can estimate a log-linear model using xtivreg (Anderson-Hsiao FD IV) and GMM methods (e.g. Arellano-Bond xtdpd) without difficulty. So I estimate that as a robustness test, but it is not my preferred model.
Thank you.
I have a panel dataset, but for simplicity, I refer to all observations by t, and drop the i.
I have reason to believe that Y grows exponentially from one period to the next. However, although Y is usually positive, it is sometimes negative. So a log-linear regression is not feasible. Therefore, I am estimating a linear-exponential regression.
So Yt = B0 + B1*Yt-1 + (B2)^(Yt-1) + various covariates + et
Thus, I use the nl command to estimate this non-linear equation.
However, including a lagged dependent variable creates endogeneity bias. There are two options: (1) the Anderson-Hsiao estimator, FD IV, i.e. first-differences with lags of Y being instruments for Y, and (2) GMM.
I cannot use the xtivreg command to perform FD IV because my equation is non-linear.
So my plan is this:
(1) Use the nl command to perform the first-stage regression, i.e. regress Yt on appropriate lags of itself - including the term (B2)^(Yt-1) - and any other instruments. Save the predicted values of Yt. Manually calculate statistics such as the Sargan, etc.
(2) Use the nl command to perform the second-stage regression using the predicted values of Yt-1.
(3) Wrap #1 and #2 together in a bootstrapped program.
Any suggestions for a better way than that?
I do have an alternative measure of Y that is strictly positive. This alternative measure is theoretically less sound than my preferred measure. But it has the advantage of being strictly positive, so I can estimate a log-linear model using xtivreg (Anderson-Hsiao FD IV) and GMM methods (e.g. Arellano-Bond xtdpd) without difficulty. So I estimate that as a robustness test, but it is not my preferred model.
Thank you.