Dear Stata Forum,
I'm currently working on a SEM model which is a quite new field to me. However I managed to implement the following model successfully (The results are in line with other literature in my field, they are also economicaly intuitivly):
So far everyting works out - I also tried the sem command (which yields comparable results).
However I now want to:
1) Estimate exactly this model for two groups of individuals in my sample, coded as a binary variable (0/1) and
2) Do a T-Test if predictor1 is different for both groups in regard to repsonse1, repsonse2 and response3
My questions:
1) Is there any possibility to do this via a sample split? If yes how? My idea is to save coefficients and standard errors and then use it later in "test". However so far I was not able to figure out a way to do this?
2) I tried to use the gsem ability of including factor variables (like in a single equation model as interaction term), however the results where completly strange and I guess I did not implement it properly. How do I implement the use of factor variables in my model and then use it in a test of different coefficients?
Thanks a lot for your help!
kind regards,
Johann
I'm currently working on a SEM model which is a quite new field to me. However I managed to implement the following model successfully (The results are in line with other literature in my field, they are also economicaly intuitivly):
Code:
constraint 1 -[repsonse1]predictor1 -[repsonse2]predictor1 +[repsonse3]predictor1 =1 constraint 2 -[repsonse1]predictor2 -[repsonse2]predictor2 +[repsonse3]predictor2 =0 constraint 3 -[repsonse1]predictor3 -[repsonse2]predictor3 +[repsonse3]predictor3 =0 constraint 4 -[repsonse1]lagged_response1 -[repsonse2]lagged_response1 +[repsonse3]lagged_response1 =0 constraint 5 -[repsonse1]lagged_response2 -[repsonse2]lagged_response2 +[repsonse3]lagged_response2 =0 constraint 6 -[repsonse1]lagged_response3 -[repsonse2]lagged_response3 +[repsonse3]lagged_response3 =0 global constraints "1 2 3 4 5 6" gsem (repsonse1 <- predictor1 predictor2 predictor3 lagged_response1 lagged_response2 lagged_response3)/* */ (repsonse2 <- predictor1 predictor2 predictor3 lagged_response1 lagged_response2 lagged_response3)/* */ (repsonse3 <- predictor1 predictor2 predictor3 lagged_response1 lagged_response2 lagged_response3)/* */ , nocapslatent vce(cid) const( 1 2 3 4 5 6 )
However I now want to:
1) Estimate exactly this model for two groups of individuals in my sample, coded as a binary variable (0/1) and
2) Do a T-Test if predictor1 is different for both groups in regard to repsonse1, repsonse2 and response3
My questions:
1) Is there any possibility to do this via a sample split? If yes how? My idea is to save coefficients and standard errors and then use it later in "test". However so far I was not able to figure out a way to do this?
2) I tried to use the gsem ability of including factor variables (like in a single equation model as interaction term), however the results where completly strange and I guess I did not implement it properly. How do I implement the use of factor variables in my model and then use it in a test of different coefficients?
Thanks a lot for your help!
kind regards,
Johann
Comment