I have the following problem and really appreciate any help:
I have a dataset consisting of financial data across firms over time (unbalanced panel data). I need to run this regression equation:
Since I want to use the formula as it is stated there, I need to run nonlinear least square regression (in the study I referring to, they did the same). The problem is that I don't know how to include year and industry effects (dummies). Below I elaborate on my approach so far:
I already ran this function using nls():
NLLS_1 <- nls(log(tobinsq) ~ log(a) + log(1 + bRD_STOCK_TA + cGREEN_STOCK_RD + dNONGREEN_STOCK_RD + eGREEN_CIT_STOCK_PA + f*NONGREEN_CIT_STOCK_PA), data = FINAL_US, start = list(a = a1, b = b1, c = c1, d = d1, e = e1, f = f1))
I determined the starting values (a-f) using pooled OLS with the approximation log(1+x)=x. So far everything is fine.
The problem yet is that I need to include time and industry effects. Similarly, as in pooled OLS, I was thinking to add year dummies (factor variable "year") and industry dummies (factor variable "sic") to my regression equation. Unfortunately, this doesn't work the way it works in OLS - I guess because in nls() I use a mathematical formula.
How can I control for year and industry effects in nls()? I really appreciate any help! Let me know if you need further information! Thanks in advance!