Announcement

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

  • Entry mode study - reshape variables?

    Hello
    I want have a data set with a parent firm country variable, a subsidiary country variable, a ownership variable telling how much ownership the parent has in the subsidiary, and a cultural distance variable for each subsidiary country. I.e. CulturalDistanceBrazil, CulturalDistanceRussia, CulturalDistanceIndia, CulturalDistanceChina and CulturalDistanceSouthAfrica. So basically I want stata to only use the culturaldistance variable when it matches with the parent and subsidiary country variable. So if the parent is from Australia and the subsidiary is from Brazil, I want stata to only use the value for CulturalDistanceBrazil for Australia. Right now it has matched all the culturaldistance variables for each parent country. So for all parent firms from Australia it has a value for their culturaldistance for Russia, India, China, South Africa. So if I do my analysis it will regress all the values and not only the one I need for every entry, right?
    I have no clue on what to do, so I can't provide any code. I use Stata17
    Best regards, Frederik

  • #2
    I managed to do it with the following code:
    input intuncBR intuncRU intuncIN intuncCN intuncZA subcountry 1 2 3 4 5 "BR" 6 7 8 9 10 "RU" 11 12 13 14 15 "IN" 16 17 18 19 20 "CN" 21 22 23 24 25 "ZA" end // Create new variable called internal_uncertainty generate internal_uncertainty = . // Replace values based on subcountry replace internal_uncertainty = intuncBR if subcountry == "BR" replace internal_uncertainty = intuncRU if subcountry == "RU" replace internal_uncertainty = intuncIN if subcountry == "IN" replace internal_uncertainty = intuncCN if subcountry == "CN" replace internal_uncertainty = intuncZA if subcountry == "ZA"

    Comment

    Working...
    X