Announcement

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

  • Setting up a 3-dimensional panel in Stata with interaction term

    Dear All,

    I have a query related to a using a 3-dimensional panel in Stata which I am unable to figure out from Stata manual and previous threads. I have 2 donor countries j; 4 recipient countries i; and 5 years t.

    My aim is to compare the role of corruption in foreign aid allocation decision of United States vs United Kingdom.

    For this purpose, the dependent variable is the absolute amount of aid received by a recipient country i from donor j (i.e., U.S amd U.K) in year t. Corruption in a recipient country is my key explanatory variable. I am having some recipient specific control variables i.e., GDP and some donor-recipient specific control variables i.e., Trade between donor j and recipient i in a year. I intend to estimate the following equation:

    Aidijt = beta0 + beta1 Corruptionit + beta2 Corruption*DonorDummy + beta3 GDPit + beta4 Tradejit + uijt

    DonorDummy takes a value 1 for US and 0 for UK.

    I am using the following code

    Code:
    regress Aid Corruption Corruption#DonorDummy GDP Trade, vce (cluster donorID recipientID)
    I have the following 2 question in this regard:

    Question 1: I am assuming that the coefficient beta2will indicate the influence of recipient’s corruption on aid allocation decisions of US in comparison with UK i.e., a positive significant coefficient will tell: U.S will give more aid to corrupt countries than U.K. Whereas, beta1, beta3, and beta4 will be same for both the donors.

    Earlier studies on this topic have estimated separate equations as follows for each donor and through the following equations:

    USAidit = beta0+ beta1Corruptionit+ beta2GDPit+ beta3Tradejit + uijt
    UKAidit = beta0+ beta1Corruptionit+ beta2GDPit+ beta3Tradejit + uijt

    They have then compared the magnitude of coefficient beta1 in the two equations to tell how different is US from UK in giving aid to corrupt countries.

    But as per my understanding, separate equations will not serve the purpose of comparison and U.S.and UK’s aid should be estimated within one equation. I am wondering if my strategy of setting the 3-dimensional panel and interacting donor dummy with the key explanatory variable makes any sense in the way I have put my data in Stata and in general?


    Question 2: How should I set my panel ID? I have tried to set it as follows:
    • egen panelid = group(Donor Recipient)
    • xtset panelid Year
    I am a bit unsure if my strategy i.e., setting the panel and coefficient interpretation is appropriate or is there any alternate way of doing it in Stata.


    Here is my example data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str5 Donor str8 Recipient float(Year GDP CorruoptionScore TradeShare Aid panelid DonorDummy)
    "UK" "Kenya"    2010 40 3   70   87654 1 0
    "UK" "Kenya"    2011 41 3   70   34567 1 0
    "UK" "Kenya"    2012 43 3   73    4567 1 0
    "UK" "Kenya"    2013 44 4   74    9875 1 0
    "UK" "Kenya"    2014 49 3   77  675776 1 0
    "UK" "Pakistan" 2010 60 5   33     767 2 0
    "UK" "Pakistan" 2011 67 5   31 5435424 2 0
    "UK" "Pakistan" 2012 68 6   35 1432345 2 0
    "UK" "Pakistan" 2013 70 5   39  878854 2 0
    "UK" "Pakistan" 2014 71 7   22    2345 2 0
    "US" "Kenya"    2010 40 3   20    6789 3 1
    "US" "Kenya"    2011 41 3   21    5658 3 1
    "US" "Kenya"    2012 43 3   21    7678 3 1
    "US" "Kenya"    2013 44 4   23    4324 3 1
    "US" "Kenya"    2014 49 3   23   76468 3 1
    "US" "Pakistan" 2010 60 5   10   98979 4 1
    "US" "Pakistan" 2011 67 5   10 8687879 4 1
    "US" "Pakistan" 2012 68 6   11   88768 4 1
    "US" "Pakistan" 2013 70 5 12.5     687 4 1
    "US" "Pakistan" 2014 71 7   11     345 4 1
    end

    Looking forward to your feedback.

    Best regards,
    Shazmeen Maroof.



  • #2
    You didn't get a quick answer. You'll increase your chances of a helpful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    With 40 observations, you can't do a lot of messing around - you don't have sufficient observations. Just dummies for donor and recipient result in 8 panel effects.

    Comment


    • #3
      Dear Phil,

      Many thanks for telling this.

      Let me post it again.

      As for the observation number, they are much higher than 40.

      I didn’t want to confuse the audience with lots of variables and observations so I created an example data set with minimum number of observations. Originally, I have 125 recipient countries in the sample.

      Best regards,
      Shazmeen

      Comment


      • #4
        Dear All,

        I have a query related to a using a 3-dimensional panel in Stata which I am unable to figure out from Stata manual and previous threads. I have 2 donor countries j; 4 recipient countries i; and 5 years t.

        My aim is to compare the role of corruption in foreign aid allocation decision of United States vs United Kingdom.

        For this purpose, the dependent variable is the absolute amount of aid received by a recipient country i from donor j (i.e., U.S amd U.K) in year t. Corruption in a recipient country is my key explanatory variable. I am having some recipient specific control variables i.e., GDP and some donor-recipient specific control variables i.e., Trade between donor j and recipient i in a year. I intend to estimate the following equation:

        Aidijt = beta0 + beta1 Corruptionit + beta2 Corruption*DonorDummy + beta3 GDPit + beta4 Tradejit + uijt

        DonorDummy takes a value 1 for US and 0 for UK.

        I am using the following command

        Code:
        regress Aid Corruption Corruption#DonorDummy GDP Trade, vce (cluster donorID recipientID)
        I have the following 2 question in this regard:

        Question 1: I am assuming that the coefficient beta2will indicate the influence of recipient’s corruption on aid allocation decisions of US in comparison with UK i.e., a positive significant coefficient will tell: U.S will give more aid to corrupt countries than U.K. Whereas, beta1, beta3, and beta4 will be same for both the donors.

        Earlier studies on this topic have estimated separate equations as follows for each donor and through the following equations:

        USAidit = beta0+ beta1Corruptionit+ beta2GDPit+ beta3Tradejit + uijt
        UKAidit = beta0+ beta1Corruptionit+ beta2GDPit+ beta3Tradejit + uijt

        They have then compared the magnitude of coefficient beta1 in the two equations to tell how different is US from UK in giving aid to corrupt countries.

        But as per my understanding, separate equations will not serve the purpose of comparison and U.S.and UK’s aid should be estimated within one equation. I am wondering if my strategy of setting the 3-dimensional panel and interacting donor dummy with the key explanatory variable makes any sense in the way I have put my data in Stata and in general?


        Question 2: How should I set my panel ID? I have tried to set it as follows:

        Code:
        egen panelid = group(Donor Recipient)
        xtset panelid Year
        I am a bit unsure if my strategy i.e., setting the panel and coefficient interpretation is appropriate or is there any alternate way of doing it in Stata.

        Here is my example data:

        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input str5 Donor str8 Recipient float(Year GDP CorruoptionScore TradeShare Aid panelid DonorDummy)
        "UK" "Kenya"    2010 40 3   70   87654 1 0
        "UK" "Kenya"    2011 41 3   70   34567 1 0
        "UK" "Kenya"    2012 43 3   73    4567 1 0
        "UK" "Kenya"    2013 44 4   74    9875 1 0
        "UK" "Kenya"    2014 49 3   77  675776 1 0
        "UK" "Pakistan" 2010 60 5   33     767 2 0
        "UK" "Pakistan" 2011 67 5   31 5435424 2 0
        "UK" "Pakistan" 2012 68 6   35 1432345 2 0
        "UK" "Pakistan" 2013 70 5   39  878854 2 0
        "UK" "Pakistan" 2014 71 7   22    2345 2 0
        "US" "Kenya"    2010 40 3   20    6789 3 1
        "US" "Kenya"    2011 41 3   21    5658 3 1
        "US" "Kenya"    2012 43 3   21    7678 3 1
        "US" "Kenya"    2013 44 4   23    4324 3 1
        "US" "Kenya"    2014 49 3   23   76468 3 1
        "US" "Pakistan" 2010 60 5   10   98979 4 1
        "US" "Pakistan" 2011 67 5   10 8687879 4 1
        "US" "Pakistan" 2012 68 6   11   88768 4 1
        "US" "Pakistan" 2013 70 5 12.5     687 4 1
        "US" "Pakistan" 2014 71 7   11     345 4 1
        end

        Looking forward to your feedback.

        Best regards,
        Shazmeen Maroof.

        Comment

        Working...
        X