Hi, I am trying to represent my data in a stacked chart. I have data on export and import. What I am trying to show is the percentage of the observations in which i have observations for both export and import, either export or import and no observations at all. To be more precise, I'm trying to visualise it in a similar manner as Helpman et al. (2008) does in their "Estimating Trade Flows: Trading Partners and Trading Volumes", which looks like this

I have created two three variables. TradeBoth is = 1 given that both export and import has a positive value. TradeOne is 1 given that one of export or import has a positive value, but the other one is unobserved. A variable "missing" that is 1 given that both export and import is missing. If these variables are not 1, then I have them as "."
I tried initially to run something like this to then built upon it. However, I can't get percent to work.
Im trying to do this through year 1996 to 2017.
Thank you for any helpful answers!
Sincerely,
Jonathan
I have created two three variables. TradeBoth is = 1 given that both export and import has a positive value. TradeOne is 1 given that one of export or import has a positive value, but the other one is unobserved. A variable "missing" that is 1 given that both export and import is missing. If these variables are not 1, then I have them as "."
I tried initially to run something like this to then built upon it. However, I can't get percent to work.
graph bar (percent) TradeBoth TradeOne missing, over(year) stack title("Data distribution")
Thank you for any helpful answers!
Sincerely,
Jonathan
Comment