Dear all,
I am trying to estimate a gravity model using panel data in Stata. My data set has 836,814 observations, from year 1950 to 2013 (I have 3 year periods).
To estimate the gravity equation, I would use different methods. Among other the xtreg command.
A preview of my investigation:
For the dependent variable I have pairs of countries (I have the data on imports and exports). My independent variables include fta_wto (binary variable takes value of 1 if both the importer and exporter are members of a regional trade agreement), gdp_exporter, gdp_importer, land area_exporter, land area_importer, population_exporter, population_importer, distance. My main focus is to test if the effect of regional trade agreements (the effect of variable fta_wto) on trade between country pairs is bigger for small countries compared to the effect on big countries. I would like to test the interaction between smallcountry##fta_wto and bigcountry##fta_wto (if the coeficient for small countries is bigger for small country pairs).
My question is how can I interact the smallpair dummy with fta_wto and later test if the interaction coefficient is bigger for country pairs made of small countries than country pairs made of big countries?
I was thinking of creating a dummy variable that equals 1 if both of the countries in a pair are small countries and 0 if one or both are big countries. To distinguish between countries, I would use GDP or the population size of countries (the criteria for forming dummy variables would be based on literature). Is it enough that I create only one dummy variable? For example, the dummy variable for small country pair (equals 1 if both are small, and 0 if the country pair has big countries) or should I create two separate dummy variables, one for small country pairs and another for country pairs with big countries? Which command can I use to test my hypothesis?
I'm very sorry if my grammar is not perfect, I hope that I expressed myself in a way that you will understand my problem.
Any help will be much appreciated.
Best regards, Davorin Jersic.
I am trying to estimate a gravity model using panel data in Stata. My data set has 836,814 observations, from year 1950 to 2013 (I have 3 year periods).
To estimate the gravity equation, I would use different methods. Among other the xtreg command.
A preview of my investigation:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str3(Exporter Importer) double import int year double(pop_exp pop_importer) byte fta_wto "ABW" "AFG" 0 1950 .04971200227737427 8.150367736816406 0 "ABW" "AFG" 0 1953 .052584998309612274 8.573216438293457 0 "ABW" "AFG" 0 1956 .05451599881052971 9.061938285827637 0 "ABW" "AFG" 0 1959 .05651800334453583 9.624606132507324 0 "ABW" "AFG" 0 1962 .05622600018978119 9.141782760620117 0 "ABW" "AFG" 0 1965 .057360000908374786 9.7650146484375 0 "ABW" "AFG" 0 1968 .05838499963283539 10.46576976776123 0 "ABW" "AFG" 0 1971 .05943800136446953 11.323446273803711 0 "ABW" "AFG" 0 1974 .06052500009536743 12.273589134216309 0 "ABW" "AFG" 0 1977 .06036600098013878 13.034460067749023 0 "ABW" "AFG" 0 1980 .060095999389886856 13.180431365966797 0 "ABW" "AFG" 0 1983 .06220399960875511 12.241928100585937 0 "ABW" "AFG" 0 1986 .06264399737119675 11.262438774108887 0 "ABW" "AFG" 0 1989 .0610320009291172 11.215323448181152 0 "ABW" "AFG" 0 1992 .06823500245809555 13.81187629699707 0 "ABW" "AFG" 0 1995 .08032599836587906 17.58607292175293 0 "ABW" "AFG" 0 1998 .08727599680423737 19.496835708618164 0 "ABW" "AFG" 0 2001 .09289400279521942 21.347782135009766 0 "ABW" "AFG" 0 2004 .09874200075864792 24.0186824798584 0 "ABW" "AFG" 0 2007 .10121899843215942 26.3492431640625 0 "ABW" "AFG" 0 2010 .10159700363874435 28.397811889648437 0 "ABW" "AFG" 0 2013 .10291100293397903 30.551673889160156 0 "ABW" "AGO" 0 1950 .04971200227737427 4.117617130279541 0 "ABW" "AGO" 0 1953 .052584998309612274 4.293839931488037 0 "ABW" "AGO" 0 1956 .05451599881052971 4.490992069244385 0 "ABW" "AGO" 0 1959 .05651800334453583 4.7146759033203125 0 "ABW" "AGO" 0 1962 .05622600018978119 5.150075912475586 0 "ABW" "AGO" 0 1965 .057360000908374786 5.433841228485107 0 "ABW" "AGO" 0 1968 .05838499963283539 5.715372085571289 0 "ABW" "AGO" 0 1971 .05943800136446953 6.049213886260986 0 "ABW" "AGO" 0 1974 .06052500009536743 6.475333213806152 0 "ABW" "AGO" 0 1977 .06036600098013878 6.9895501136779785 0 "ABW" "AGO" 0 1980 .060095999389886856 7.637141227722168 0 "ABW" "AGO" 0 1983 .06220399960875511 8.489864349365234 0 "ABW" "AGO" 0 1986 .06264399737119675 9.320677757263184 0 "ABW" "AGO" 0 1989 .0610320009291172 10.051133155822754 0 "ABW" "AGO" 0 1992 .06823500245809555 11.002758026123047 0 "ABW" "AGO" 0 1995 .08032599836587906 12.104951858520508 0 "ABW" "AGO" 0 1998 .08727599680423737 13.137541770935059 0 "ABW" "AGO" 0 2001 .09289400279521942 14.385283470153809 0 "ABW" "AGO" 0 2004 .09874200075864792 15.976715087890625 0 "ABW" "AGO" 0 2007 .10121899843215942 17.71282386779785 0 "ABW" "AGO" 0 2010 .10159700363874435 19.549123764038086 0 "ABW" "AGO" 0 2013 .10291100293397903 21.47161865234375 0 "ABW" "ALB" 0 1950 .04971200227737427 1.2271560430526733 0 "ABW" "ALB" 0 1953 .052584998309612274 1.3146079778671265 0 "ABW" "ALB" 0 1956 .05451599881052971 1.4344758987426758 0 "ABW" "ALB" 0 1959 .05651800334453583 1.5713289976119995 0 "ABW" "ALB" 9816 1962 .05622600018978119 1.7113189697265625 0 "ABW" "ALB" 0 1965 .057360000908374786 1.8647910356521606 0 "ABW" "ALB" 0 1968 .05838499963283539 2.0222721099853516 0 "ABW" "ALB" 0 1971 .05943800136446953 2.1878530979156494 0 "ABW" "ALB" 0 1974 .06052500009536743 2.350123882293701 0 "ABW" "ALB" 0 1977 .06036600098013878 2.5135459899902344 0 "ABW" "ALB" 0 1980 .060095999389886856 2.6719970703125 0 "ABW" "ALB" 0 1983 .06220399960875511 2.8439600467681885 0 "ABW" "ALB" 0 1986 .06264399737119675 3.022634983062744 0 "ABW" "ALB" 0 1989 .0610320009291172 3.227942943572998 0 "ABW" "ALB" 0 1992 .06823500245809555 3.2470390796661377 0 "ABW" "ALB" 0 1995 .08032599836587906 3.18778395652771 0 "ABW" "ALB" 0 1998 .08727599680423737 3.1285300254821777 0 "ABW" "ALB" 0 2001 .09289400279521942 3.0641109943389893 0 "ABW" "ALB" 0 2004 .09874200075864792 3.0145790576934814 0 "ABW" "ALB" 0 2007 .10121899843215942 2.940880060195923 0 "ABW" "ALB" 0 2010 .10159700363874435 2.856673002243042 0 "ABW" "ALB" 0 2013 .10291100293397903 2.7736198902130127 0 "ABW" "AND" 0 1950 .04971200227737427 .006175999995321035 0 "ABW" "AND" 0 1953 .052584998309612274 .005590999964624643 0 "ABW" "AND" 0 1956 .05451599881052971 .006221000105142593 0 "ABW" "AND" 0 1959 .05651800334453583 .00723899994045496 0 "ABW" "AND" 0 1962 .05622600018978119 .010317000560462475 0 "ABW" "AND" 0 1965 .057360000908374786 .013623000122606754 0 "ABW" "AND" 0 1968 .05838499963283539 .017215998843312263 0 "ABW" "AND" 0 1971 .05943800136446953 .020549999549984932 0 "ABW" "AND" 0 1974 .06052500009536743 .024806998670101166 0 "ABW" "AND" 0 1977 .06036600098013878 .029395999386906624 0 "ABW" "AND" 0 1980 .060095999389886856 .033583998680114746 0 "ABW" "AND" 0 1983 .06220399960875511 .04162699729204178 0 "ABW" "AND" 0 1986 .06264399737119675 .04647600278258324 0 "ABW" "AND" 0 1989 .0610320009291172 .050515998154878616 0 "ABW" "AND" 0 1992 .06823500245809555 .05972199887037277 0 "ABW" "AND" 0 1995 .08032599836587906 .06324499845504761 0 "ABW" "AND" 0 1998 .08727599680423737 .06472799926996231 0 "ABW" "AND" 0 2001 .09289400279521942 .06531599909067154 0 "ABW" "AND" 0 2004 .09874200075864792 .07324700057506561 0 "ABW" "AND" 0 2007 .10121899843215942 .0807570070028305 0 "ABW" "AND" 0 2010 .10159700363874435 . 0 "ABW" "AND" 0 2013 .10291100293397903 . 0 "ABW" "ARE" 0 1950 .04971200227737427 .07151999324560165 0 "ABW" "ARE" 0 1953 .052584998309612274 .0774800032377243 0 "ABW" "ARE" 0 1956 .05451599881052971 .08583100140094757 0 "ABW" "ARE" 2313 1959 .05651800334453583 .09786999970674515 0 "ABW" "ARE" 32637 1962 .05622600018978119 .10877399891614914 0 "ABW" "ARE" 89306 1965 .057360000908374786 .1463409960269928 0 "ABW" "ARE" 0 1968 .05838499963283539 .18076199293136597 0 "ABW" "ARE" 0 1971 .05943800136446953 .2722109854221344 0 "ABW" "ARE" 0 1974 .06052500009536743 .45284798741340637 0 "ABW" "ARE" 0 1977 .06036600098013878 .7236170172691345 0 "ABW" "ARE" 0 1980 .060095999389886856 1.0148249864578247 0 "ABW" "ARE" 0 1983 .06220399960875511 1.2153799533843994 0 end
For the dependent variable I have pairs of countries (I have the data on imports and exports). My independent variables include fta_wto (binary variable takes value of 1 if both the importer and exporter are members of a regional trade agreement), gdp_exporter, gdp_importer, land area_exporter, land area_importer, population_exporter, population_importer, distance. My main focus is to test if the effect of regional trade agreements (the effect of variable fta_wto) on trade between country pairs is bigger for small countries compared to the effect on big countries. I would like to test the interaction between smallcountry##fta_wto and bigcountry##fta_wto (if the coeficient for small countries is bigger for small country pairs).
My question is how can I interact the smallpair dummy with fta_wto and later test if the interaction coefficient is bigger for country pairs made of small countries than country pairs made of big countries?
I was thinking of creating a dummy variable that equals 1 if both of the countries in a pair are small countries and 0 if one or both are big countries. To distinguish between countries, I would use GDP or the population size of countries (the criteria for forming dummy variables would be based on literature). Is it enough that I create only one dummy variable? For example, the dummy variable for small country pair (equals 1 if both are small, and 0 if the country pair has big countries) or should I create two separate dummy variables, one for small country pairs and another for country pairs with big countries? Which command can I use to test my hypothesis?
I'm very sorry if my grammar is not perfect, I hope that I expressed myself in a way that you will understand my problem.
Any help will be much appreciated.
Best regards, Davorin Jersic.