Dear Cuneyt,
You are right, PROC QLIM has an endogeneity test, also you can model random effects (both random intercept, as in your case, and random coefficients) for a single SUBJECT value in PROC QLIM using the RANDOM statement. However, if you are using the RANDOM statement you can have only one MODEL statement. Therefore, you cannot model your reduced form equation (X1 = c0 + c2 X2 + c3 Z + v + e2) along with your structural equation (Y = b0 + b1 X1 + b2 X2 + u + e1) which are both necessary for the endogeneity test. However, you should go ahead and test for endogeneity of X1 in PROC QLIM even if you are not able to model the random effects. Because, if you do have any correlation between X1 and u and/or e1 this will show up in the test implying that you have the problem of endogeneity in your main model. The only thing that you won't be sure of is that you won't know which error component X1 is correlated to, as PROC QLIM will treat them as a single error term (say, v=u+e1).
For your second question, in either case you do have the problem of endogeneity. Because, the assumptions u|(X1, X2)~N(0, sigma_u^2) or e1|(X1, X2, u)~N(0, sigma_e1^2) will be violated and this implies endogeneity. Therefore, the test for endogeneity done in QLIM will give you an answer.
For your third question, no, you don't need to worry about the endogeneity because you are already correcting for it by modeling both the structural and the reduced form equations together (as you would do in PROC QLIM). The only thing is that, you won't be modelling the random effect. The last statement answers your last question.
I hope this helps,
Best regards,
Gunce
... View more