Announcement

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

  • combine variables panel data graphs

    Hi I'm working with panel data, trade among 10 countries in the past 27 years. I want to add and graph trade openness for each country against all other countries for the period. Example Argentina against Bolivia, Brazil, Colombia, Ecuador... for the entire period.
    How do I create a new variable with the sum of all the combinations for Argentina? Example I would need to add Argentina against all 9 other countries for 1993 and then for 1994 and so on and then create a line (time) graph
    thank you

  • #2
    Code:
    gen argentina = country == "Argentina"
    collapse (sum) openness ,by(argentina year)
    twoway (line openness year if argentina)(line openness if !argentina)

    Comment


    • #3
      Thank you. I was able to sum, but when graphing can I create a line for each country? I am just starting to work with STATA and panel data.
      thanks for your help

      Comment

      Working...
      X