Introduction to Econometrics: Exercises


3. Real and nominal variables. The consumer price index (CPI) measures the price of a basket of goods and services over time. In this exercise, we will use the CPI to deflate the 2021 price of a barrel of oil into 2011 prices. The following variables have been defined for you: cpi_2011, cpi_2021, oil_2021.

To convert time t prices into prices in year s, we use the following adjustment:

\[ real\_price_{t} = \frac{price_{t}}{cpi_{t}} cpi_{s} \]

cpi_2011 <- 227.223 cpi_2021 <- 280.126 oil_2021 <- 75.33 # Calculate the 2021 price of oil in 2011 prices. real_oil_price_2021 <- (___ / ___) * ___ # Print the real oil price in 2021. print(___) # Print nominal oil price in 2021. ___(oil_2021) # Calculate the 2021 price of oil in 2011 prices. real_oil_price_2021 <- (oil_2021 / cpi_2021) * cpi_2011 # Print the real oil price in 2021. print(real_oil_price_2021) # Print nominal oil price in 2021. print(oil_2021) test_error() test_object("real_oil_price_2021", incorrect_msg="Did you calculate the real oil price correctly?") success_msg("Well done!")
Check the problem description for an overview of deflating prices.

Previous Exercise Next Exercise