SHAZAM Questions and Answers (Q&A) - RSS feedhttp://community.econometrics.com/questions/SHAZAM Econometrics, Statistics and Analytics Communityen<font color="white">Copyright <b>SHAZAM Analytics, 2018</b></font>Wed, 10 Sep 2014 08:04:59 +0000Metafrontier Estimationhttp://community.econometrics.com/question/531/metafrontier-estimation/Hi all, I have got some problem when computing metafrontier parameters.I've followed the SHAZAM program given by Rao, O'Donnell and Battese.I have tried the command for several times but there is always some errors.It says "...MISSING OBSERVATION SET TO -99999". I appreciate your help very much. See the error message and the command that I have used below.
The file parm.txt contains estimated parameters of group frontiers (by column).
The file sfa#.txt contains n# data observations for group#. Sections 1 and 3 are problem-specific.
1. SET NUMBERS OF PARAMETERS ETC.
gen1 nparms=8
gen1 ngroups=3
gen1 n1=100
gen1 n2=170
gen1 n3=120
2. READ THE ESTIMATED PARAMETERS OF THE GROUP FRONTIERS
sample 1 nparms
read(parm.txt)parm/rows=nparms cols=ngroups
do# = 1,ngroups
dim b# nparms
copy parm b# / fcols=#;# tcols = 1;1
endo
3. READ THE DATA AND CONSTRUCT DATA MATRICES AND VECTORS
gen1 j2=n1+1
gen1 j3=n1+n2+1
gen1 k2=n1+n2
gen1 n=n1+n2+n3
sample 1 n
genr one=1
genr dummy=0
Read (sfa1.txt) group t lnq lx1-lx7
sample j2 k2
read (sfa2.txt) group t lnq lx1-lx7
sample j3 n
read (sfa3.txt) group t lnq lx1-lx7
sample 1 n
matrix x = one|lx1|lx2|lx3|lx4|lx5|lx6|lx7
dim x1 n1 nparms x2 n2 nparms x3 n3 nparms
copy x x1/frows=1;n1 trows=1;n1
copy x x2/frows=j2;k2 trows=1;n2
copy x x3/frows=j3;n trows=1;n3
do #=1,ngroups
matrix yhat# = x#*b#
endo
matrix b = -(yhat1'|yhat2'|yhat3')'
stat x / means = xbar
matrix c = ((-xbar')|xbar')'
matrix A = (-x)|x
lp c A b / iter = 5000 primal = bstar
dim beta1 nparms beta2 nparms
gen1 p1=nparms+1
gen1 p2=nparms*2
copy bstar beta1 / frows=1;nparms trows=1;nparms
copy bstar beta2 / frows=p1;p2 trows=1;nparms
matrix beta = beta1-beta2
print beta
5. OBTAIN AND PRINT METATECHNOLOGY RATIOS
do# = 1,ngroups
matrix xbeta# = x#*beta
matrix mtr# = exp(yhat#)/exp(xbeta#)
stat mtr#
print mtr#
endo
stop
Wed, 10 Sep 2014 03:59:27 +0000http://community.econometrics.com/question/531/metafrontier-estimation/Answer by SHAZAMHelp for <p>Hi all, I have got some problem when computing metafrontier parameters.I've followed the SHAZAM program given by Rao, O'Donnell and Battese.I have tried the command for several times but there is always some errors.It says "...MISSING OBSERVATION SET TO -99999". I appreciate your help very much. See the error message and the command that I have used below. </p>
<p>The file parm.txt contains estimated parameters of group frontiers (by column).
The file sfa#.txt contains n# data observations for group#. Sections 1 and 3 are problem-specific.</p>
<pre><code>1. SET NUMBERS OF PARAMETERS ETC.
gen1 nparms=8
gen1 ngroups=3
gen1 n1=100
gen1 n2=170
gen1 n3=120
2. READ THE ESTIMATED PARAMETERS OF THE GROUP FRONTIERS
sample 1 nparms
read(parm.txt)parm/rows=nparms cols=ngroups
do# = 1,ngroups
dim b# nparms
copy parm b# / fcols=#;# tcols = 1;1
endo
3. READ THE DATA AND CONSTRUCT DATA MATRICES AND VECTORS
gen1 j2=n1+1
gen1 j3=n1+n2+1
gen1 k2=n1+n2
gen1 n=n1+n2+n3
sample 1 n
genr one=1
genr dummy=0
Read (sfa1.txt) group t lnq lx1-lx7
sample j2 k2
read (sfa2.txt) group t lnq lx1-lx7
sample j3 n
read (sfa3.txt) group t lnq lx1-lx7
sample 1 n
matrix x = one|lx1|lx2|lx3|lx4|lx5|lx6|lx7
dim x1 n1 nparms x2 n2 nparms x3 n3 nparms
copy x x1/frows=1;n1 trows=1;n1
copy x x2/frows=j2;k2 trows=1;n2
copy x x3/frows=j3;n trows=1;n3
do #=1,ngroups
matrix yhat# = x#*b#
endo
matrix b = -(yhat1'|yhat2'|yhat3')'
stat x / means = xbar
matrix c = ((-xbar')|xbar')'
matrix A = (-x)|x
lp c A b / iter = 5000 primal = bstar
dim beta1 nparms beta2 nparms
gen1 p1=nparms+1
gen1 p2=nparms*2
copy bstar beta1 / frows=1;nparms trows=1;nparms
copy bstar beta2 / frows=p1;p2 trows=1;nparms
matrix beta = beta1-beta2
print beta
5. OBTAIN AND PRINT METATECHNOLOGY RATIOS
do# = 1,ngroups
matrix xbeta# = x#*beta
matrix mtr# = exp(yhat#)/exp(xbeta#)
stat mtr#
print mtr#
endo
stop
</code></pre>
http://community.econometrics.com/question/531/metafrontier-estimation/?answer=533#post-id-533That Missing Value message is generally for information only, informing you there were missing values detected and the internal code used is -99999. i.e. When SHAZAM sees that value it treats it as a missing value.
However only by seeing the data file can we check the layout. So please can you upload your data and script files to this question so I can look at this and verify that the data was loaded as you intended.
To ensure that the data was read correctly you can manually place the -99999 into every missing value location yourself. It is also often useful to then use the WRITE command to write out the data. This will allow you to check that SHAZAM read the data as you intended.Wed, 10 Sep 2014 06:17:51 +0000http://community.econometrics.com/question/531/metafrontier-estimation/?answer=533#post-id-533Comment by TING LIN for <p>That Missing Value message is generally for information only, informing you there were missing values detected and the internal code used is -99999. i.e. When SHAZAM sees that value it treats it as a missing value. </p>
<p>However only by seeing the data file can we check the layout. So please can you upload your data and script files to this question so I can look at this and verify that the data was loaded as you intended.</p>
<p>To ensure that the data was read correctly you can manually place the -99999 into every missing value location yourself. It is also often useful to then use the WRITE command to write out the data. This will allow you to check that SHAZAM read the data as you intended.</p>
http://community.econometrics.com/question/531/metafrontier-estimation/?comment=534#post-id-534Hi,I have sent the data and script files to your help email.Looking forward hearing back from you.Thank you so much!Wed, 10 Sep 2014 08:04:59 +0000http://community.econometrics.com/question/531/metafrontier-estimation/?comment=534#post-id-534