Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • malmq.ado could not work with the save(filename) option, anyone know what's wrong with the ado file? ado file and datasets attached


    I use malmq.ado to calculate malmquist index in stata 15, it works OK.But when I want to save results to dta file with the sav(filename) option or sav(filename) option,there comes error message. MY codes are as follows:

    gen dmu = province
    sort year province
    malmq Farming Grain= labor1 fert tpower area ,ort(i) period(year) trace saving(farming)

    then there comes a error message: <istmt>: 3499 file_exists() not found

    MY data are as follows:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str24 province int year double(Farming labor1 fert tpower area)
    "上海"                   1999   87.9   93.5  20.4  151.1  315.1
    "云南省"                1999    395 1677.1  90.5 1255.1 6421.6
    "内蒙古自治区"       1999  318.7  555.4    76 1241.5   8201
    "北京"                   1999   91.2   74.3    19  410.4  343.9
    "吉林省"                1999  388.4  544.4 116.2  897.3 5578.4
    "四川省"                1999  792.8 2747.1 210.3 1606.9 9169.1
    "天津"                   1999   91.6   82.6  15.8  481.5  485.6
    "宁夏回族自治区"    1999   51.3  158.5  29.3  377.9 1268.8
    "安徽省"                1999  706.8 2007.5 255.7 2766.2 5971.7
    "山东省"                1999 1254.9 2485.9 419.3 6096.6 7689.3
    "山西省"                1999  206.3  659.1    86   1655 4588.6
    "广东省"                1999  859.7 1550.7 172.8 1734.9 3272.2
    "广西壮族自治区"    1999  454.9 1622.4 153.8 1375.2 4407.9
    "新疆维吾尔自治区" 1999  340.9  385.2  78.3  814.2 3985.7
    "江苏省"                1999 1095.1   1529 335.4 2767.9 5061.7
    "江西省"                1999  388.2 1082.6 116.7    853 2993.4
    "河北省"                1999  879.6 1653.3 272.4 6622.8 6883.3
    "河南省"                1999 1231.9 3310.2 399.9 5342.9 8110.3
    "浙江省"                1999    519 1080.1  92.7 1912.5 2125.3
    "海南省"                1999  131.7  198.8  19.4  191.7  762.1
    "湖北省"                1999    646 1259.1 251.5 1363.7 4949.5
    "湖南省"                1999  624.5 2111.5 180.9   2007   3953
    "甘肃省"                1999  242.7  698.2  64.5  969.9 5024.7
    "福建省"                1999  425.2  789.9 124.3  838.7 1434.7
    "西藏自治区"          1999   26.1   92.7   2.7   99.6  362.6
    "贵州省"                1999  278.7 1432.9  67.7  555.4 4903.5
    "辽宁省"                1999  510.9  675.6 116.3 1236.5 4174.8
    "重庆市"                1999  249.6  958.9    71  558.5      .
    "陕西省"                1999  327.7 1016.4   132 1010.8 5140.5
    "青海省"                1999   29.3  146.9   7.3  241.9    688
    "黑龙江省"             1999    460  812.5 126.3 1559.7  11773
    "上海"                   2000   89.8     88  19.3  142.5  315.1
    "云南省"                2000  416.4 1695.9 112.1 1301.3 6421.6
    "内蒙古自治区"       2000  308.4  553.7  74.8 1350.3   8201
    "北京"                   2000   91.1   72.7  17.9  349.2  343.9
    "吉林省"                2000  320.3  541.6 112.1 1015.4 5578.4
    "四川省"                2000  785.4 2643.4 212.6 1679.7 9169.1
    "天津"                   2000   83.4   80.9  16.6  593.4  485.6
    "宁夏回族自治区"    2000     47  158.6  23.6  380.6 1268.8
    "安徽省"                2000  675.3 2017.9 253.2 2975.9 5971.7
    "山东省"                2000 1300.4 2473.7 423.2 7025.2 7689.3
    "山西省"                2000  218.3  662.7    87 1701.3 4588.6
    "广东省"                2000  807.9 1588.5 176.2 1763.9 3272.2
    "广西壮族自治区"    2000  418.8 1574.5 157.8 1467.9 4407.9
    "新疆维吾尔自治区" 2000  360.5  387.9  79.2  851.2 3985.7
    "江苏省"                2000   1096 1502.7 335.5 2925.3 5061.7
    "江西省"                2000  387.3 1004.4 106.9  902.3 2993.4
    "河北省"                2000  846.7 1678.2 270.6 7000.4 6883.3
    "河南省"                2000 1264.3   3569 419.5 5780.6 8110.3
    "浙江省"                2000  520.4   1021  89.7 1990.1 2125.3
    "海南省"                2000    145  204.4  26.3  200.9  762.1
    "湖北省"                2000  615.7 1204.8 247.1   1414 4949.5
    "湖南省"                2000  633.8 2104.4 182.2 2209.7   3953
    "甘肃省"                2000    239  706.1  64.5 1056.9 5024.7
    "福建省"                2000    421  778.2 123.3  873.3 1434.7
    "西藏自治区"          2000   26.4     91   2.5  114.5  362.6
    "贵州省"                2000  279.6 1377.9  71.3  618.6 4903.5
    "辽宁省"                2000  463.5  683.3 109.8 1339.8 4174.8
    "重庆市"                2000  244.7  925.2    72  586.5      .
    "陕西省"                2000  327.8 1010.2 131.2 1042.9 5140.5
    "青海省"                2000   24.9  145.3   7.2  256.2    688
    "黑龙江省"             2000  414.4  808.5 121.6 1613.8  11773
    "上海"                   2001   95.5   86.6  20.3  133.9  315.1
    "云南省"                2001  431.3 1710.5   120 1397.8 6421.6
    "内蒙古自治区"       2001  307.6  546.4  79.3 1423.6   8201
    "北京"                   2001   89.7   70.6  15.7    395  343.9
    "吉林省"                2001  405.9  535.9 114.1 1096.5 5578.4
    "四川省"                2001  769.9 2595.8   212 1735.1 9169.1
    "天津"                   2001   86.7   82.2  17.3  603.3  485.6
    "宁夏回族自治区"    2001   49.4  157.1  24.6  407.6 1268.8
    "安徽省"                2001    688 1991.1 280.7   3165 5971.7
    "山东省"                2001 1401.3 2444.2 428.6 7689.6 7689.3
    "山西省"                2001  191.3  662.4  84.9 1767.5 4588.6
    "广东省"                2001  817.9 1584.2 195.1 1760.2 3272.2
    "广西壮族自治区"    2001  439.9 1572.9 168.1 1552.4 4407.9
    "新疆维吾尔自治区" 2001  348.8  388.2  83.3  880.9 3985.7
    "江苏省"                2001 1142.7 1474.6   338 2957.9 5061.7
    "江西省"                2001  405.9  997.9 109.7   1002 2993.4
    "河北省"                2001  899.4 1675.4 273.4 7244.4 6883.3
    "河南省"                2001 1331.6 3482.5 441.7 6078.7 8110.3
    "浙江省"                2001  529.5  990.8  90.3 2017.2 2125.3
    "海南省"                2001  141.3  204.9    27  212.2  762.1
    "湖北省"                2001  658.3 1186.4 245.3 1469.2 4949.5
    "湖南省"                2001  665.7 2079.6 184.3   2358   3953
    "甘肃省"                2001    254  705.3  66.1   1122 5024.7
    "福建省"                2001  433.2  768.8 117.4  888.8 1434.7
    "西藏自治区"          2001   27.6   89.5     3  123.2  362.6
    "贵州省"                2001  279.9 1373.8    70  647.9 4903.5
    "辽宁省"                2001  503.1  681.7 109.8 1401.3 4174.8
    "重庆市"                2001  250.4  887.9  72.6  628.1      .
    "陕西省"                2001  337.4    994 131.1 1099.8 5140.5
    "青海省"                2001   28.9  144.3   7.2  264.7    688
    "黑龙江省"             2001  450.6  808.3 123.2 1648.3  11773
    "上海"                   2002   97.2   84.2  17.7  126.9  315.1
    "云南省"                2002  445.3 1715.6   125 1460.4 6421.6
    "内蒙古自治区"       2002  332.1  563.3  82.8 1510.2   8201
    "北京"                   2002   90.1   67.8  14.9  381.8  343.9
    "吉林省"                2002  419.7  524.2   117 1150.7 5578.4
    "四川省"                2002  807.4   2516 209.6 1803.7 9169.1
    "天津"                   2002   86.1   81.5  17.6  612.7  485.6
    end

    Thanks.

  • #2
    You've gotten farther than others have reported. Where did you find malmq.ado to install? When I install the DEA package it provides malmq.sthlp but no ado file... .

    Comment


    • #3
      I found it in a Chinese forum.Here is malmq.ado.
      Attached Files

      Comment


      • #4
        Open malmq.ado in the do-file editor or in the text editor of your choice and find the following section of code at lines 303-310
        Code:
                if ("`replace'" == "") {
                    local dotpos = strpos("`saving'",".")
                    if (`dotpos' > 0) {
                        mata: file_exists("`saving'")
                    }
                    else {
                        mata: file_exists("`saving'.dta")
                    }
        and change both occurrences of
        Code:
        file_exists
        to
        Code:
        _file_exists
        which is how the function is defined at the bottom of malmq.ado.

        With that said, the existence of this error concerns me - it doesn't speak well for how thoroughly the code was tested. Or perhaps the code was altered by someone other than the author at some point. I hope the math is better than the mechanics.

        Comment


        • #5
          Amazing!It worked!Maybe I found the wrong malmq.ado.Thank you heartily.

          Comment


          • #6
            In post #4 of the topic I created at

            https://www.statalist.org/forums/for...ivity-analysis

            you will find a link to what I now believe is the most current version of the author's software.

            Comment


            • #7
              Hello Dear all!
              I'm using stata for Malmquist's index productivity! My data set contains 3 period and 6 DMU!

              I-I use all that you recommended in #4 (of 17 May 2019, 09:06) using the file provided by Yuanqin XU in #3, but bugs hold. As follows what I get:

              . do "C:\Users\R\AppData\Local\Temp\STD04000000.tmp "

              . malmq irh_dep = ondep_volr, ort(out) period(annee)
              ----------------------------------------------------------------------------------
              name: malmquistlog
              log: C:\Users\R\Documents\Stata12\malmquist.log
              log type: text
              opened on: 4 Sep 2019, 13:21:44


              Cross CRS-DEA Result:
              from thru t t1
              dmu:3 2015 2016 1.80705 3.26798
              dmu:1 2015 2016 9.04657 6.07987
              dmu:2 2015 2016 .956796 1.04515
              dmu:4 2015 2016 4.70948 6.50749
              dmu:5 2015 2016 18.2561 29.5288
              dmu:6 2015 2016 4.8196 2.53209
              dmu:3 2016 2017 1.19203 1.5844
              dmu:1 2016 2017 5.97445 7.93192
              dmu:2 2016 2017 1.91825 .838906
              dmu:4 2016 2017 4.87848 4.12921
              dmu:5 2016 2017 33.0212 16.0067
              dmu:6 2016 2017 4.71731 4.22577

              Malmquist efficiency OUTPUT Oriented DEA Results:
              type mismatch
              r(109);




              II-I have also tried to use (as you had said) what it the most current version of the author's provided on 'Source Forge'. As follows what I get :


              . do "C:\Users\R\AppData\Local\Temp\STD04000000.tmp "

              . malmq irh_dep = ondep_volr, ort(out) period(annee)
              ------------------------------------------------------------------------------------------------------------------------------------------------
              name: malmquistlog
              log: C:\Users\R\Documents\Stata12\malmquist.log
              log type: text
              opened on: 4 Sep 2019, 13:10:34
              <istmt>: 3499 _uniqrowmat() not found
              r(3499);


              Those error messages hold despite deleting (or uninstalling) old ado files related to ''dea'' and ''malmq'' command, as recommended.

              Please what can I do?
              Thank you beforehand!
              Regards!

              Comment

              Working...
              X