Hi all,

I please have another question.

So I have variables Revenue_GDP, Expenditure_GDP, Consumption_GDP, GovernmentConsumption_GDP, Investment_GDP, Exports_GDP Imports_GDP, Debt_GDP, Deficit_GDP
which are all as a % of GDP. I am trying to generate for example Revenue = Revenue_GDP * GDP_LCU to get Revenue figure and likewise for all the above variables.

I tried the following loop but it gives me error saying Revenue_GDP is already defined

The formula I am using:

local vars3 "Revenue Expenditure Consumption GovernmentConsumption Investment Exports Imports Debt Deficit"
local vars4 "Revenue_GDP Expenditure_GDP Consumption_GDP GovernmentConsumption_GDP Investment_GDP Exports_GDP Imports_GDP Debt_GDP Deficit_GDP"
foreach x of varlist `vars3' {
foreach s of varlist `vars4' {
gen `x' = `s' * GDP_LCU
}
}

Can you help me correct it. Thanks.