Saturday, September 5, 2020

Percentage change using a base

Hi, I have a panel with items and prices. I have one group of items that belongs to one geographical zone and another group of items that belong to other zone. I would like to compare the inflation rate between this two zones across time but using the same base year (for example when wave == 1). When I want to observe just the variation without a base year I did


Code:
gen price_change_per = (price/price[_n-1] -1)*100 if code==code[_n-1]
egen mean_val = mean(price_change_per), by(wave)
for each of the 2 zones. How should I do if instead of that, I want to to the percentage change always with respect to the same base year? Thanks

ps: as this is my first post in Stata, please let me know if I'm not following the style or the format that should be used for this type of questions.

No comments:

Post a Comment