Announcement

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

  • Converting values from multiple currencies to USD in panel dataset

    Hey, I'm very new to Stata and currently working on my thesis. As I am fighting my way through, there is a small issue I do not know how to solve. I have firms from multiple countries operating in different currencies. As I would like to compare these, I would need all of them to be in USD. I already have the exchange rates for the respective years in the data but don't know how to move on. I included a copy of my dataset through dataex (sorry if I did something not like its supposed to be, this is my second time asking on here). However, in total there are multiple currencies as opposed to the extract below (ARS;BRA;CLP;COP;MEX;PEN). Basically I am looking for a code that applies the exchange rate to the respective variables if they are not in USD. I would highly appreciate any help!!


    [CODE]
    input str18 isin double fyear str4 curcd double(ROA ROE FirmSize FirmLeverage FirmLiquidity) float FX_lcu_us
    "US81728J1097" 2019 "USD" -.04604051565377532 -.060712117424377696 3.608861746127905 .030224244393890157 5.257111935683365 .
    "US3397501012" 2018 "USD" .09414783836848337 .19884513159988979 7.118089945668588 .11492993628508758 1.3838208194714123 .
    "US22305A1034" 2019 "USD" -.5273216873940842 -7.309981018216845 7.80242106815153 .7404200582215213 2.1531824354623783 .
    "ARP9897X1319" 2014 "ARS" .04316388081743817 .12394327412914774 12.2479532794939 .17276101153658047 .7888918037701907 8.075276
    "US96108P1030" 2010 "USD" -.028157091365950255 -.06959790193238087 5.564792400980406 .3667086731195728 .9123144872626797 .
    "US7534221046" 2016 "USD" -.20139496841387078 -1.1656120652742759 5.494307580169685 0 .8944021317363624 .
    "US5024311095" 2020 "USD" .030275974025974026 .053995367689635206 10.51759152575562 .20676406926406926 1.5724056603773584 .
    "US9266131005" 2019 "USD" -.22504387403854667 -.24379779470876783 5.950783167700958 0 11.88227329655079 .


  • #2
    Perhaps somebody who understands finance and economics is already responding to this in a more helpful way. But I don't quite see what you're looking to do here. I'm guessing that the variable FX_luc_us is the exchange rate in question. You don't explain whether this means that there are 8.07... ARS per USD or 8.07 USD per ARS, though I would guess the former.

    But more important, to what variable(s) should the exchange rate be applied. My understanding, which may be wrong, is that ROA, ROE, leverage, and liquidity are ratios that would be the same regardless of the currency unit. Is Firm Size an absolute variable that is actually denominated in currency units?

    If my guesses are correct, you could do this:
    Code:
    gen size_usd = FirmSize if curcd == "USD"
    replace size_usd = FirmSize / Fx_lcu_us if missing(size_usd)

    Comment

    Working...
    X