I have a number of macro variables that are common and are only differentiated in their names by adding the ISO country code. Variables are in time series format. That is for inflation and GDP in Australia, the USA, and Canada, which would be
etc.
There are about one hundred countries and fifty such variables. What I need is to rename all variables by replacing the underscore ( _ )with a dot . That should look like
And then create first differences for all of them, How is that done? I tried for example the following, but it failed
Thank you
Best
Giorgio
Code:
AUS_inflation CAN_inflation USA_inflation AUS_gdp, CAN_gdp USA_gdp
There are about one hundred countries and fifty such variables. What I need is to rename all variables by replacing the underscore ( _ )with a dot . That should look like
Code:
AUS.inflation, USA.inflation, CAN.inflation AUS.gdp CAN.gdp USA.gdp
Code:
foreach var in AUS_inflation- USA_gdp{
gen D`var'= D.`var'
}
Best
Giorgio

Comment