Announcement

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

  • Calculating ratio conditional upon 4 specifc variables from a large dataset

    Dear community,

    I am a new user, looking for calculating ratio from a large dataset conditional upon ‘Reporter’, ‘Partner’, ‘Year’ and ‘TradeFlow’. My data is organised in the following way:
    Reporter Product Partner Year TradeFlowName TradeFlowCode TradeValue TradeValue
    AUS 2709 IND 2011 Export 6 50 A
    IND 2709 AUS 2011 Import 5 65 B
    IND 2709 AUS 2011 Export 6 100 C
    AUS 2709 IND 2011 Import 5 115 D
    I want to calculate:
    Ratio= A/B, conditional upon specific Reporter’, ‘Partner’, ‘Year’ and ‘TradeFlow’ [here, A=50 and B=65]

    I am using Stata Version SE 14.2

    As a new user I searched a lot but could not solved the problem.
    If any of you kindly help me how to write the command, will be much helpful.
    Thank you!

    Kind Regards, Farhad
Working...
X