<p>I am prepared to look quite the fool, but hopefully you can help me.</p>
<p>I am trying to perform Stochastic Frontier Analysis on a balanced panel dataset by estimating the following model:</p>
<p><a href="https://i.sstatic.net/l1v3d.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/l1v3d.png" alt="enter image description here" /></a></p>
<p>I think the translog specification is quite clear. The beta(r) term denotes a vector of dummy variables corresponding to the cross-sectional units i. The most important part of this model are the two error terms at the very end. These are specified following the Battese and Coelli (1992) model. To those unfamiliar with their idea, they specify the error terms as follows:
<a href="https://i.sstatic.net/uugIm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/uugIm.png" alt="enter image description here" /></a></p>
<p>Where the eta is the inefficiency term and T is the largest year. This is also known as a time-decay model. My question is, where do I go wrong when trying to estimate this model is Stata? I was reading the manuals and found that either of the commands should estimate my desired model:</p>
<p><em>xtfrontier lnY $xvar, tvd</em></p>
<p>or</p>
<p><em>sfpanel lnY $xvar, model(bc92)</em></p>
<p>In this case the term <em>$xvar</em> denotes the independent variables. Now supposing that these commands are initial correct. I should then be able to proceed to estimating technical inefficiency. I have found that this should be done using the following command:</p>
<p><em>predict te, jlms</em></p>
<p>My problem is that the technical efficiency estimates that are obtained are wildly wrong. That is, although they should be between 0 and 1, the estimates are always around 0.999, and hardly vary at all. My guess is that I have made a mistake somewhere. I would appreciate any suggestions of where this might be. I know that it is unlikely to be a data problem since I have used similar data to others. This means that I might not used the right procedure in Stata. Sorry if I have made a really stupid error. Any suggestions will be appreciated no matter how vague.</p>
<p>Thank again!</p>

CC BY-SA 4.0
2020-11-25T21:13:01.923Z
I think it is perhaps hard on yourself to self-classify as a metrics novice, given the complexity of your problem. I know there's actually software for measuring productivity, not sure if you're aware? I remember seeing it here: https://economics.uq.edu.au/cepa/software
EB3112
CC BY-SA 4.0
2020-11-25T21:45:41.730Z
I thought it would be my reserve option since I have no prior experience with it all and I am more familiar with Stata. I could give it a go and see what happens though.
Econometric Novice
CC BY-SA 4.0
2020-11-25T21:49:30.627Z
Totally fair. Hope you manage to get some help on the SFA stuff regardless; I know it's not easy having looked into some research in the past.
EB3112
CC BY-SA 4.0
2020-11-26T12:09:52.977Z
Thanks. I tried the Frontier Program last night and it worked perfectly. All the estimates look great. It was a lot more user-friendly that expected!
Econometric Novice
CC BY-SA 4.0
2020-11-26T13:04:05.427Z
Nice one, glad to hear it!
EB3112
CC BY-SA 4.0
2022-08-11T20:21:45.810Z
I'm curious if you ever figured out the correct Stata codes to run SFA? I'm running each year one at a time with the cross sectional code because my panel is not balanced. I've tried both the "frontier" command and the "sfmodel" command and for some years all of my observations are .99. It's so frustrating! I'm also looking at the software suggested in the comments, but I'm running on a Mac. Thanks so much!
Jessica
<productivity><paneldata><stata>
Stochastic Frontier Analysis (SFA) in Stata: Technical Efficiency Estimates
Econometric Novice
# Stochastic Frontier Analysis (SFA) in Stata: Technical Efficiency Estimates

(Asked by: username_0 on 2020-11-25)

I am prepared to look quite the fool, but hopefully you can help me.

I am trying to perform Stochastic Frontier Analysis on a balanced panel dataset by estimating the following model:

[![enter image description here](https://i.sstatic.net/l1v3d.png)](https://i.sstatic.net/l1v3d.png)

I think the translog specification is quite clear. The beta(r) term denotes a vector of dummy variables corresponding to the cross-sectional units i. The most important part of this model are the two error terms at the very end. These are specified following the Battese and Coelli (1992) model. To those unfamiliar with their idea, they specify the error terms as follows:
[![enter image description here](https://i.sstatic.net/uugIm.png)](https://i.sstatic.net/uugIm.png)

Where the eta is the inefficiency term and T is the largest year. This is also known as a time-decay model. My question is, where do I go wrong when trying to estimate this model is Stata? I was reading the manuals and found that either of the commands should estimate my desired model:

*xtfrontier lnY $xvar, tvd*

or

*sfpanel lnY $xvar, model(bc92)*

In this case the term *$xvar* denotes the independent variables. Now supposing that these commands are initial correct. I should then be able to proceed to estimating technical inefficiency. I have found that this should be done using the following command:

*predict te, jlms*

My problem is that the technical efficiency estimates that are obtained are wildly wrong. That is, although they should be between 0 and 1, the estimates are always around 0.999, and hardly vary at all. My guess is that I have made a mistake somewhere. I would appreciate any suggestions of where this might be. I know that it is unlikely to be a data problem since I have used similar data to others. This means that I might not used the right procedure in Stata. Sorry if I have made a really stupid error. Any suggestions will be appreciated no matter how vague.

Thank again!

**Tags:** productivity, paneldata, stata

> **Comments:**
> **username_1**: I think it is perhaps hard on yourself to self-classify as a metrics username_0, given the complexity of your problem. I know there's actually software for measuring productivity, not sure if you're aware? I remember seeing it here: https://economics.uq.edu.au/cepa/software  
> **username_0**: I thought it would be my reserve option since I have no prior experience with it all and I am more familiar with Stata. I could give it a go and see what happens though.  
> **username_1**: Totally fair. Hope you manage to get some help on the SFA stuff regardless; I know it's not easy having looked into some research in the past.  
> **username_0**: Thanks. I tried the Frontier Program last night and it worked perfectly. All the estimates look great. It was a lot more user-friendly that expected!  
> **username_1**: Nice one, glad to hear it!  
> **username_2**: I'm curious if you ever figured out the correct Stata codes to run SFA? I'm running each year one at a time with the cross sectional code because my panel is not balanced. I've tried both the "frontier" command and the "sfmodel" command and for some years all of my observations are .99. It's so frustrating! I'm also looking at the software suggested in the comments, but I'm running on a Mac. Thanks so much!  

---

## 0 answers

