Page 1 of 1

Making Calculations in panel data within a series

Posted: Thu Jun 22, 2017 1:21 pm
by yasinuzun
Hi everyone,
I hope you're doing great.
I have a question and could not find the answer in the previous topics.
I have a panel data. one of the series is the GDPs of some countries. I want to make calculations using the data within this GDP series, for example, dividing the GDP of all other countries to GDP of USA. This is a part of a long formula.
So, the GDP (cgdpo in the attached file) data is simply;
S. Arabia-1970
S. Arabia-2014
USA-1970
USA-2014

I need to calculate S. Arabia/USA for each year to be used in another calculation.
I need to do this for 190 countries so I need an easy way doing this other than working in a time series and stacking into panel.
Thank you very much for your help.
Kind regards,

Re: Making Calculations in panel data within a series

Posted: Thu Jun 22, 2017 2:18 pm
by startz
Roughly

Code: Select all

series GDPUSA = @meansby(cgdpo,@date,"if countrycode=""USA""")
series ratio = cgdpo/GDPUSA