Hi,
I am using gsem and I want to use "if statement" so that I include some observations for my analysis. Can you please help me with this. I am getting "not sorted" error.

The command I am using is : gsem (y1 <- x1 x2 x3, cloglog)(y2 <- x1 x2 x3, cloglog) if newvar==1, covstructure(e._En, unstructured) vce(cluster ID) nocapslatent