Announcement

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

  • Calculation of RCA (Revealed Comparative Advantage)

    Dear Statalist,

    I am trying to calculate RCA(Revealed Comparative Advantage) to use in my thesis. I am following the paper by Dalum (1999) and Laursen (2005), in order to explore more on RCA.
    In the paper of Dalum (1999) and Laursen (2005), they not only calculated RCA and RSCA(Revealed Symmetric Comparative Advantage) but also the equation below, in order to examine country's specialization pattern.

    I am having a difficult time in estimating the equation, which is as follows:


    Which t1 is the initial year and t2 is the final year of RSCA(revealed symmetric comparative advantage) in sector i at country j.

    For me, since I am having a dataset from 2005 to 2015, it would be RSCA2015 = 𝛼𝑖 + 𝛽𝑖𝑅𝑆𝐢𝐴 2005 + πœ€π‘–π‘—. To explain a little bit more of my dataset, it is 10 ASEAN economies from 2005 to 2015 on 5 specific sectors. The variables I have are year, country, sector, exp, Xik, Xi, Xk, X, RCA, RSCA. (So, I have calculated RCA and RSCA.)
    It is very difficult for me to understand the equation and how to regress the equation with data. I would appreciate anyone who knows would give me some help.

    Could you give me any advice on how I should deal with this equation?
    I would appreciate your advice and please excuse my posting if there are any missing points in the post.

  • #2
    Hi Lee Eunice,
    It looks like you meant to include an equation from a paper, but it did not show up. I am somewhat familiar with RCA methods but it is hard to follow your question without more details.

    As an aside, you may want to check out the following paper: French, Scott. "Revealed comparative advantage: What is it good for?." Journal of International Economics 106 (2017): 83-103.

    Regards,
    Tom

    Comment


    • #3
      Hello Professor Zylkin,

      Thank you for the suggestion. I will check out the paper.

      I am sorry that the equation didn't show up. This is the equation that I wanted to show:

      RSCAijt2 = ai + bi RSCAijt1+eij

      I tried to search everywhere to regress this equation, but I cannot figure it out.

      I have already calculated the RCA and RSCA indices. However, I don't know how to approach the equation.
      If there are any more details to add, please let me know and I will add it.

      Regards,
      Eunice

      Comment


      • #4
        Hi Eunice,

        I assume the issue is not that you don't know you how to perform a regression of the form y=a+bx+e (that would just be reg y x with appropriate options for the standard errors.)

        Thus I am under the impression that you are having a problem with how to regress a variable y at t=2 on that same variable at t=2. For that, I think you should reshape your data using reshape wide so that you have a separate variable for each year of RCA. But if that's not right, perhaps you could provide more details about what the issue is that you are having.

        Regards,
        Tom

        Comment


        • #5
          Professor Zylkin,

          Thank you for the reply.

          Since my dataset is from 2005 to 2015, the equation should be RSCAij2015= ai + bi RSCAij2005+eij.
          So, I tried 10-year leg, but it came out like this.

          Code:
          . xtset country year, delta(10)
          time values with period less than delta() found
          r(451);
          Could you give me any advice on this?

          I do not understand what you mean by
          Thus I am under the impression that you are having a problem with how to regress a variable y at t=2 on that same variable at t=2.
          Thank you.

          Regards,
          Eunice

          Comment


          • #6
            Hi Eunice,
            I meant to say "I am under the impression that you are having a problem with how to regress a variable y at t=2 on that same variable at t=1." Sorry about that.

            The error you are getting for delta has to do with the fact that you are telling xtset that the observations in your data are spaced out by 10 years, but actually there are observations that are less than 10 years apart. I don't think you actually need to put "delta(10)" in order to use a time series operator to refer to the 10 year lag. Assuming you have annual data, it should just be L10.

            That said, my understanding is that you only have two years of data and you regressing data from the second year on data from the first. Using "reshape wide" so that you have one column for RCA at t=1 and another for RCA at t=2 makes more sense to me than using xtset based on this understanding. Others may disagree...

            Regards,
            Tom

            Comment


            • #7
              Dear Prof. Zylkin,

              I will show the dataset.

              Code:
              * Example generated by -dataex-. To install: ssc install dataex
              clear
              input int year str5 country float(exp1 RCA RSCA)
              2005 "PHL"      168.4  .3120224   -.5243643
              2005 "KHM"        8.7    .32541  -.50896704
              2005 "IDN"     1308.9 1.1169997   .05526678
              2005 "BRN"       30.9  .8391601  -.08745292
              2005 "PHL"     1245.6  2.006744    .3348286
              2005 "KHM"       25.1  1.584503   .22615688
              2005 "IDN"     4659.3  .8761111  -.06603492
              2005 "BRN"       42.6  1.005925  .002953779
              2005 "IDN"      505.9  .4965255   -.3364289
              2005 "THA"      105.2 .06821845   -.8722762
              2005 "SGP"    54522.5  .9787697  -.01072906
              2005 "MYS"        853  .6985787  -.17745504
              2005 "VNM"      168.3  .4961784    -.336739
              2005 "BRN"       30.8 1.4117076    .1707121
              2005 "BRN"      232.5 1.2096813    .0948921
              2005 "IDN"    19679.4 1.0281997  .013903795
              2005 "ASEAN"  32062.4  .9712712 -.014573734
              2005 "MYS"     1300.2 1.7971493   .28498632
              2005 "IDN"     1098.7  1.819968   .29077205
              2005 "PHL"     1053.1  3.293222    .5341494
              2005 "ASEAN" 119609.8 1.0067886 .0033828234
              2005 "MYS"    22423.7  .9776024 -.011325622
              2005 "SGP"    16453.4 1.0630002   .03053815
              2005 "KHM"      494.7  .9850138 -.007549679
              2005 "PHL"     2853.9 1.0130807   .00649786
              2005 "VNM"      311.8 1.0572072    .0278082
              2005 "VNM"     5145.9  .9288254   -.0369005
              2005 "MYS"       2561  1.823667   .29170123
              2005 "ASEAN"   3544.3  .9458473 -.027829865
              2005 "VNM"      144.4  .8263403   -.0950862
              2005 "THA"        668  .7310891  -.15534206
              2005 "SGP"     5360.4 1.8076453   .28765932
              2005 "THA"      828.3  .4670286   -.3632999
              2005 "THA"    30787.8 1.0628047  .030446265
              2005 "PHL"     9114.6  .8990212  -.05317413
              2005 "ASEAN"   6625.7 1.0476462   .02326875
              2005 "THA"     8857.7  1.100446   .04782126
              2005 "ASEAN"     7317 1.0059713 .0029767687
              2005 "SGP"      412.7  .2348866   -.6195819
              2005 "SGP"     2567.3  .7527701  -.14105093
              2005 "VNM"     2118.1  1.375917    .1582197
              2005 "BRN"      648.1  .9369514  -.03255043
              2005 "MYS"     5521.8  .8663803  -.07159295
              2005 "KHM"      158.9 1.1386682  .064838566
              2005 "KHM"       27.7   .900868  -.05215091
              2006 "SGP"    69907.3  .9634959 -.018591406
              2006 "KHM"      704.4  .9067054  -.04892975
              2006 "KHM"       17.4  .4518505   -.3775523
              2006 "KHM"         47 1.1650611   .07623855
              2006 "PHL"     1488.5 2.1241992   .35983595
              2006 "MYS"        902 1.1983907   .09024362
              2006 "ASEAN" 143824.3 1.0067208  .003349136
              2006 "PHL"     1205.4   2.92013    .4898128
              2006 "IDN"     3995.8  .6837119   -.1878517
              2006 "VNM"       2734 1.3702326   .15620095
              2006 "MYS"     1919.1 1.5019827   .20063396
              2006 "SGP"     6236.6 1.7340993   .26849768
              2006 "BRN"       33.5  1.262032   .11583927
              2006 "THA"      201.9 .12144222   -.7834178
              2006 "VNM"      180.7  .8536741   -.0789383
              2006 "IDN"    21168.9 1.0444251   .02172989
              2006 "ASEAN"   7420.4  1.000249 .0001244986
              2006 "IDN"     1530.1  2.467899    .4232819
              2006 "VNM"      207.6  .5777458  -.26763132
              2006 "PHL"      345.2  .5160739   -.3191969
              2006 "PHL"    13453.9  .9969895 -.001507525
              2006 "IDN"      345.9  .3442931   -.4877708
              2006 "BRN"       48.2 1.0696658  .033660404
              2006 "BRN"      346.8 1.3860103   .16178064
              2006 "THA"     9739.5 1.0070747  .003524888
              2006 "VNM"      391.1 1.1402286    .0655204
              2006 "THA"    35690.2 1.0641029   .03105605
              2006 "SGP"      708.3  .3191341   -.5161461
              2006 "ASEAN"  40058.9  .9724475 -.013968678
              2006 "KHM"       43.2 1.8178546   .29024017
              2006 "BRN"       30.2   .702106  -.17501496
              2006 "KHM"      291.5  1.301295   .13092412
              2006 "ASEAN"     7465  1.054157  .026364595
              2006 "IDN"     1749.2 1.6619674     .248676
              2006 "BRN"      773.9  .8918296  -.05717766
              2006 "THA"      900.2  .8774093  -.06529778
              2006 "VNM"     6315.7  .9126976  -.04564362
              2006 "ASEAN"   4159.6  .9518247 -.024682203
              2006 "SGP"    23794.3  1.137341   .06425789
              2006 "THA"     1109.6  .6370964  -.22167516
              2006 "PHL"       2675  .6874744  -.18520315
              2006 "MYS"     7449.9 1.0500358    .0244073
              2006 "MYS"      624.9  .5123569   -.3224392
              2006 "SGP"     2413.9   .640694  -.21899638
              2006 "MYS"    24054.8  .9776087  -.01132239
              2007 "ASEAN" 178988.4 1.0049859  .002486765
              2007 "VNM"     7498.5  .9419454  -.02989509
              2007 "PHL"      381.7  .4298476   -.3987505
              2007 "PHL"     4540.2    .88064  -.06346774
              2007 "VNM"      218.8  .9804327  -.00988032
              2007 "MYS"     2422.1   1.24979   .11102817
              2007 "THA"      241.8 .11367525   -.7958556
              2007 "IDN"      486.4  .4162372   -.4121928
              2007 "VNM"      630.2 1.5149958   .20477004
              2007 "KHM"      334.3 1.2502717   .11121843
              end
              With this dataset, how should I do it?
              1. When regressing lagged, I encounter the error which I mentioned in previous post. If I use L10, this is how it shows.
              Code:
               reg RSCA l10.RSCA
              time variable not set
              r(111);
              2. For reshaping like you suggested, as I am not only having two years of data, then would it be appropriate to approach RSCA of 2005 at t=1 and RSCA of 2015 at t=2?


              As I am a beginner in using Stata, I lack the knowledge of it. So, I might ask a lot of basic things but I try to learn by searching and reading.

              Thank you for the advice.

              Regards,
              Eunice

              Comment


              • #8
                Hi Eunice,
                It looks to me like your data is missing a sector code, since you have multiple observations per country-year and since you said "j" was the sector in your regression.

                If you add the sector code, such that each observation is uniquely described by country-sector-year, then

                HTML Code:
                reshape wide exp1 RCA RSCA, i(country sector) j(year)
                should work.

                Regards,
                Tom

                Comment


                • #9
                  Professor Zylkin,

                  I am sorry, I missed showing the sector variable.

                  It worked! Thank you so much.
                  I have been struggling for five days, I sincerely appreciate your help.

                  Regards,
                  Eunice

                  Comment

                  Working...
                  X