I am writing this blog and would like to get somebody's help me with 2sls and 3sls in stata.
Here is my question Suppose we investigate the link between Corporate social responsibility and corporate financial performance of several firms. We assume that OLS estimates are biased. So, we decide to go for 2SLS as it can control endogenity problem. Suppose we have panal data (balance dataset from 2000 to 2005).

Suppose we write our OLS as

FP (financial performance) = CSR index + Size + Risk + error (1)

As you explained in your papers, this OLS model still suffer from endogeneity problem due to (1) unobservable omitted variables and (2) reverse causality.

So we use 2sls to address this endogenity issue. We think CSR in above equation is endogenous and we do not have propoer instrument to it. But since we have panel data, we take lag value of CSR as our instrument. So we write our 2sls as

sr index = FP + CSR (t-1) + error (2)

FP = CSR index + CSR (t-1) + Size + Risk + error (3)

My question is, how we write 3sls equation in this case and how to write stata codes for 2sls and 3sls for this example. Could somebody help me?