Announcement

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

  • Panel data for the gravity model

    Hello,

    I am trying to study the effect of environmental regulations on exports of Korea. I have created a panel dataset, which I have attached. The dataset contains export values and other necessary variables of Korea to 15 other countries over time 1990-2017. I have converted the excel sheet to .dta in Stata.
    1) some data seem to get converted into scientific notation in Stata. How should I avoid it?
    2) I would like to know how should I proceed with establishing this as a panel data set? for example, should i add a code value for korea and every other country. So, china - korea would be 1. US-Korea would be 2. and then use the command. xtreg code year, yearly

    Looking forward to a reply.

    Regards
    Priya
    Attached Files

  • #2
    Priya:
    welcome to this forum.
    Please do not post attachments, but use -dataex- instead (see the FAQ). Thanks.
    Please, show what data were not imported as you expected them to be.
    As far as your query is concerned (gravity model), take a look at Joao Santos Silva 's posts on this topic.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Apologies for the attachment. I will follow Joao Silva's post for the gravity model. The data that was not imported can be seen.

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input str2 export_country str12 import_country int year str12 export_value double(gdp_korea gdp_importcountry) float code
      "SK" "China"   1990 "1365387655"    279349355714   360857912566 0
      "SK" "China"   1991 "1002472896"    325734233313   383373318084 0
      "SK" "China"   1992 "2653601280"    350051111253   426915712711 0
      "SK" "China"   1993 "5150956544"    386302839274   444731282437 0
      "SK" "China"   1994 "6202950144"    455602962225   564324670006 0
      "SK" "China"   1995 "9143564288"    556130926913   734547898221 0
      "SK" "China"   1996 "11377036288"   598099073901   863746717504 0
      "SK" "China"   1997 "13572445184"   557503074772   961603952952 0
      "SK" "China"   1998 "10966589440"   374241351752  1029043097554 0
      "SK" "China"   1999 "13684573131"   485248229337  1093997267271 0
      "SK" "China"   2000 "18454539579"   561633125840  1211346869605 0
      "SK" "China"   2001 "18186813888"   533052076314  1339395718865 0
      "SK" "China"   2002 "23753231204"   609020054512  1470550015082 0
      "SK" "China"   2003 "35109715081"   680520724062  1660287965663 0
      "SK" "China"   2004 "49763175463"   764880644711  1955347004963 0
      "SK" "China"   2005 "61914973037"   898137194716  2285965892361 0
      "SK" "China"   2006 "69459176983"  1011797457139  2752131773355 0
      "SK" "China"   2007 "81985000000"  1122679154632  3552182311653 0
      "SK" "China "  2008 "91389000000"  1002219052968  4598206091384 0
      "SK" "China"   2009 "86703245378"   901934953365  5109953609257 0
      "SK" "China"   2010 "116837804003" 1094499338703  6100620488868 0
      "SK" "China"   2011 "134185008602" 1202463682634  7572553836875 0
      "SK" "China"   2012 "134322395607" 1222807284485  8560547314679 0
      "SK" "China"   2013 "145869498273" 1305604981272  9607224481533 0
      "SK" "China"   2014 "145327703795" 1411333926201 10482372109962 0
      "SK" "China "  2015 "137123933792" 1382764027114 11064666282626 0
      "SK" "China"   2016 "124432940703" 1414804158515 11190992550230 0
      "SK" "China"   2017 "142119046217" 1530750923149 12237700479375 0
      "SK" "US"      1990 "19446185966"   279349355714   5.979589e+12 0
      "SK" "US"      1991 "18607499264"   325734233313   6.174043e+12 0
      "SK" "US"      1992 "18153086976"   350051111253   6.539299e+12 0
      "SK" "US"      1993 "18218604544"   386302839274   6.878718e+12 0
      "SK" "US"      1994 "20703432704"   455602962225   7.308755e+12 0
      "SK" "US"      1995 "24343730176"   556130926913    7.66406e+12 0
      "SK" "US"      1996 "21925582848"   598099073901   8.100201e+12 0
      "SK" "US"      1997 "21850048512"   557503074772   8.608515e+12 0
      "SK" "US"      1998 "22783270912"   374241351752   9.089168e+12 0
      "SK" "US"      1999 "29600909026"   485248229337   9.660624e+12 0
      "SK" "US"      2000 "37806064725"   561633125840  1.0284779e+13 0
      "SK" "US"      2001 "31357343072"   533052076314  1.0621824e+13 0
      "SK" "US"      2002 "32942694684"   609020054512  1.0977514e+13 0
      "SK" "US"      2003 "34368716782"   680520724062   1.151067e+13 0
      "SK" "US"      2004 "43026562199"   764880644711  1.2274928e+13 0
      "SK" "US"      2005 "41499402451"   898137194716  1.3093726e+13 0
      "SK" "US"      2006 "43320311038"  1011797457139  1.3855888e+13 0
      "SK" "US"      2007 "45883922080"  1122679154632  1.4477635e+13 0
      "SK" "US"      2008 "46500676172"  1002219052968  1.4718582e+13 0
      "SK" "US"      2009 "37802594458"   901934953365  1.4418739e+13 0
      "SK" "US"      2010 "49991458238"  1094499338703  1.4964372e+13 0
      "SK" "US"      2011 "56421431345"  1202463682634  1.5517926e+13 0
      "SK" "US"      2012 "58806901088"  1222807284485  1.6155255e+13 0
      "SK" "US"      2013 "62326903271"  1305604981272  1.6691517e+13 0
      "SK" "US"      2014 "70598279902"  1411333926201  1.7427609e+13 0
      "SK" "US"      2015 "70117307228"  1382764027114  1.8120714e+13 0
      "SK" "US"      2016 "66748306308"  1414804158515  1.8624475e+13 0
      "SK" "US"      2017 "68852265159"  1530750923149  1.9390604e+13 0
      "SK" "Vietnam" 1990 "NA"            279349355714     6471740806 0
      "SK" "Vietnam" 1991 "198934096"     325734233313     9613369520 0
      "SK" "Vietnam" 1992 "436161312"     350051111253     9866990236 0
      "SK" "Vietnam" 1993 "728246656"     386302839274    13180953598 0
      "SK" "Vietnam" 1994 "1027336832"    455602962225    16286433533 0
      "SK" "Vietnam" 1995 "1350987520"    556130926913    20736164459 0
      "SK" "Vietnam" 1996 "1599117056"    598099073901    24657470575 0
      "SK" "Vietnam" 1997 "1603102720"    557503074772    26843700442 0
      "SK" "Vietnam" 1998 "1329012608"    374241351752    27209602050 0
      "SK" "Vietnam" 1999 "1445149454"    485248229337    28683659007 0
      "SK" "Vietnam" 2000 "1686024586"    561633125840    31172518403 0
      "SK" "Vietnam" 2001 "1731557415"    533052076314    32685198735 0
      "SK" "Vietnam" 2002 "2240187444"    609020054512    35064105501 0
      "SK" "Vietnam" 2003 "2561234222"    680520724062    39552513316 0
      "SK" "Vietnam" 2004 "3255573658"    764880644711    45427854693 0
      "SK" "Vietnam" 2005 "3431653995"    898137194716    57633255618 0
      "SK" "Vietnam" 2006 "3927476198"   1011797457139    66371664817 0
      "SK" "Vietnam" 2007 "5760054492"   1122679154632    77414425532 0
      "SK" "Vietnam" 2008 "7804807396"   1002219052968    99130304099 0
      "SK" "Vietnam" 2009 "7149477435"    901934953365   106014659770 0
      "SK" "Vietnam" 2010 "9652073408"   1094499338703   115931749697 0
      "SK" "Vietnam" 2011 "13464921994"  1202463682634   135539438560 0
      "SK" "Vietnam" 2012 "15945972462"  1222807284485   155820001920 0
      "SK" "Vietnam" 2013 "21087581630"  1305604981272   171222025117 0
      "SK" "Vietnam" 2014 "22332857802"  1411333926201   186204652922 0
      "SK" "Vietnam" 2015 "27770750377"  1382764027114   193241108710 0
      "SK" "Vietnam" 2016 "32630457303"  1414804158515   205276172135 0
      "SK" "Vietnam" 2017 "47753837501"  1530750923149   223863996355 0
      "SK" "HK"      1990 "3779946607"    279349355714    76928290842 0
      "SK" "HK"      1991 "4769023488"    325734233313    88959620136 0
      "SK" "HK"      1992 "5909009408"    350051111253   104272278635 0
      "SK" "HK"      1993 "6430744064"    386302839274   120353947981 0
      "SK" "HK"      1994 "8014713856"    455602962225   135812069769 0
      "SK" "HK"      1995 "10681975808"   556130926913   144652912433 0
      "SK" "HK"      1996 "11130946560"   598099073901   159717233622 0
      "SK" "HK"      1997 "11725048832"   557503074772   177352785420 0
      "SK" "HK"      1998 "8583516160"    374241351752   168886163222 0
      "SK" "HK"      1999 "9048180040"    485248229337   165768095392 0
      "SK" "HK"      2000 "10708094323"   561633125840   171668164083 0
      "SK" "HK"      2001 "9451464848"    533052076314   169403241524 0
      "SK" "HK"      2002 "10144876435"   609020054512   166349228737 0
      "SK" "HK"      2003 "14653695797"   680520724062   161384522525 0
      "SK" "HK"      2004 "18127097233"   764880644711   169099768875 0
      "SK" "HK"      2005 "15531017278"   898137194716   181570082162 0
      end

      Comment

      Working...
      X