I successfully ran xtfrontier for lagged and other variables in my analysis. I am using a large panel dataset. The results are suitable.

When I try to use "predict te, te" to find the technical efficiency, it gives the "not sorted r(5);" error.

I tried to set my lagged variable as a part of my dataset and re-tried, but the same error comes up.

I'm on a tight deadline and I'd appreciate any help! Thanks.