Hi all,
I have data on 26 countries (reporter) and their exchange rates EXCH_USD_rep (local currency per US dollar). For every country I have another country-partner. I want to calculate exchange rate for each country-pair. I wanted to generate a variable EXCH_USD_par. E.g. I have year 1990. Reporter country is Australia. It's EXCH_USD_rep is 1.281056666667. I have partner country Austria. I want to create EXCH_USD_par for it. I know that in 1990 EXCH_USD_rep for Austria was .8262755899217. I don't know how to tell Stata to take EXCH_USD_rep for Austria in 1990 as EXCH_USD_par. I tried:
However, I wasn't successful. Stata generated missing values
The solution which comes to my mind is to generate additional dta file and rename reporter partner and merge it. I would prefer to find more elegant way though
I have data on 26 countries (reporter) and their exchange rates EXCH_USD_rep (local currency per US dollar). For every country I have another country-partner. I want to calculate exchange rate for each country-pair. I wanted to generate a variable EXCH_USD_par. E.g. I have year 1990. Reporter country is Australia. It's EXCH_USD_rep is 1.281056666667. I have partner country Austria. I want to create EXCH_USD_par for it. I know that in 1990 EXCH_USD_rep for Austria was .8262755899217. I don't know how to tell Stata to take EXCH_USD_rep for Austria in 1990 as EXCH_USD_par. I tried:
Code:
gen EXCH_USD_par=cond(reporter==partner, EXCH_USD_rep,.)
The solution which comes to my mind is to generate additional dta file and rename reporter partner and merge it. I would prefer to find more elegant way though

Comment