EMPIRICAL PROJECT 7 SUPPLY AND DEMAND

Size: px
Start display at page:

Download "EMPIRICAL PROJECT 7 SUPPLY AND DEMAND"

Transcription

1 EMPIRICAL PROJECT 7 SUPPLY AND DEMAND LEARNING OBJECTIVES In this project you will: convert values from natural logarithms to base 10 logarithms draw graphs based on equations give an economic interpretation of coefficients in supply and demand equations distinguish between exogenous and endogenous shocks explain how we can use exogenous supply/demand shocks to identify the demand/supply curve. Key concepts Concepts needed for this project: the natural log transformation, dummy variable, confidence interval, and statistical significance. Concepts introduced in this project: simultaneity. INTRODUCTION You may be familiar with supply and demand diagrams similar to the one shown in Figure 7.1. To find out more about demand and supply curves, read Sections 7.2 ( 7.7 ( ) and 7.8 ( in Economy, Society, and Public Policy. But how do we know what the supply and demand curves look like in the real world? Unlike the models in economics textbooks, we cannot ask consumers for their willingness to pay at different prices or ask firms to tell us their profit-maximizing decisions. Instead, usually the best data available are prices and quantities over a number of periods (both of the product we are interested in and of other products), and information about policies and other events that happened in those periods. CORE PROJECTS This empirical project is related to material in: Unit 7 ( ) of Economy, Society, and Public Policy Unit 7 ( ) and Unit 8 ( of The Economy. 393

2 EMPIRICAL PROJECT 7 SUPPLY AND DEMAND We will be looking at the US market for watermelons in described in the paper Suits Watermelon Model as an example of how to model demand and supply using available data and interpret the results. Figure 7.1 Example of supply and demand diagram: Equilibrium in the market for bread. 394

3 EMPIRICAL PROJECT 7 WORKING IN R GETTING STARTED IN R For this project you will need the following packages: tidyverse, to help with data manipulation readxl, to import an Excel spreadsheet. If you need to install either of these packages, run the following code: install.packages(c("readxl","tidyverse")) You can import the libraries now, or when they are used in the R walkthrough below. library(readxl) library(tidyverse) PART 7.1 DRAWING SUPPLY AND DEMAND DIAGRAMS First download the data on the watermelon market ( ). Read the Data dictionary tab and make sure you know what each variable represents. Download the paper Suits Watermelon Model ( ) on the watermelon market. The data is in natural logs (page 195), rather than the base 10 logarithms number scale you are used to working with (referred to as base 10 where relevant). Before plotting supply and demand curves we will first practise converting natural logarithms to numbers. In Part 7.2 we will discuss why it is useful to express relationships between variables (for example, price and quantity) in natural logs. 1 To make charts that look like those in Figure 1 in the paper, you need to convert the relevant variables to their actual values. 403

4 EMPIRICAL PROJECT 7 WORKING IN R (a) Create two new variables containing the actual values of P and Q. (b) Plot separate line charts for P and Q, with time (in years) on the horizontal axis. Make sure to label your vertical axes appropriately. Your charts should look the same as Figure 1 in the paper. R WALK-THROUGH 7.1 Importing data into R and creating tables and charts First we import the data with the read_excel function, using the na = "NA" option to indicate how missing data is recorded. library(tidyverse) ## -- Attaching packages tidyverse ## v ggplot v purrr ## v tibble v dplyr ## v tidyr v stringr ## v readr v forcats ## -- Conflicts tidyverse_conflicts() -- ## x dplyr::filter() masks stats::filter() ## x dplyr::lag() masks stats::lag() library(readxl) wm_data <- read_excel("suitsdata.xlsx", na = "NA") str(wm_data) ## Classes 'tbl_df', 'tbl' and 'data.frame': 22 obs. of 10 variables: ## $ Year : num ## $ log.q : num ## $ log.h : num ## $ log.p : num ## $ log.pc : num

5 PART 7.1 DRAWING SUPPLY AND DEMAND DIAGRAMS ## $ log.pv : num ## $ log.w : num ## $ log.n : num ## $ log.y_n: num ## $ log.pf : num Let s create p and q from their log counterparts. Remember that the variables are provided in the log to the base of 10 format, not the natural logarithm. We also transform the harvest variable log.h. The harvest will be at most as large as the crop ( q ), and therefore we convert these variables back as follows. wm_data$p <- 10^wm_data$log.p # Price wm_data$h <- 10^wm_data$log.h # Harvest quantity wm_data$q <- 10^wm_data$log.q # Crop quantity Let s produce the chart for the prices. plot(wm_data$year,wm_data$p,type = "o", # type: "p" = points, "l" = lines, "o" = points and lines xlab = "Year", ylab = "Price") Figure 7.2 Line chart for prices for watermelons. Now we create the line chart for harvest and crop quantities. 405

6 EMPIRICAL PROJECT 7 WORKING IN R plot(wm_data$year,wm_data$q,type = "o", # type: "p" = points, "l" = lines, "o" = points and lines pch = 1, lty = "dashed", xlab = "Year", ylab = "Price") # Add the harvest data lines(wm_data$year,wm_data$h, type = "o", pch = 16) # Add a legend legend(1947.5, 55, legend=c("crop", "Harvest"), col=c("black", "black"), pch = c(1,16), lty= c("dashed","solid"), cex=0.8) Figure 7.3 Line chart for harvest and crop for watermelons. Now we will plot supply and demand curves for a simplified version of the model given in the paper. We will assume that the supply curve is given by the following equation: Technical note Whenever log (or ln) is used in economics, it refers to natural logarithms. Since this equation shows the price in terms of quantity (instead of quantity in terms of price), it is technically referred to as the inverse supply curve. However, we will be using the terms supply curve and demand curve to refer to both the supply/demand curve and the inverse supply/demand curve. 406

7 PART 7.1 DRAWING SUPPLY AND DEMAND DIAGRAMS We define P as the price of a single watermelon and Q as the quantity of watermelons (in thousands). Using the same notation, the following equation describes the demand curve: To plot a curve, we need to generate a series of points (vertical axis values that correspond to particular horizontal axis values) and join them up. First we will work with the variables in natural log format, and then we will convert them to base 10 values so that our supply and demand curves will be in familiar units. 2 Plot supply and demand curves: (a) Create a table as shown in Figure 7.4. The first column contains values of Q from 500 to 10,000, in intervals of 500. Q Log Q Supply (log P) Demand (log P) Supply (P) Demand (P) 500 1,000 9,500 10,000 Figure 7.4 Calculating supply and demand. (b) Convert the values of Q to natural log format (second column of your table) and use these values, along with the numbers in the equations above, to calculate the corresponding values of log P for supply (third column) and demand (fourth column). (c) Convert the log P numbers to base 10 values (fifth and sixth columns). (d) Plot your calculated supply and demand curves on a line chart, with price (P) on the vertical axis and quantity (Q) on the horizontal axis. Make sure to label your curves (for example, using a legend). During the time period considered ( ), the market for watermelons experienced a negative supply shock due to the Second World War. Supply was limited because production inputs (land and labour) were being used for the war effort. This shock shifted the entire supply curve because the cause (Second World War) was not part of the supply equation, but was external (also known as being exogenous. Before doing the next question, draw a supply and demand diagram to illustrate what you would expect to happen to price and quantity as a result of the shock (all other things being equal). To see how oil shocks in the 1970s caused by wars in the Middle East shifted the supply curve in the oil market, see Section 7.11 ( in Economy, Society, and Public Policy. exogenous Coming from outside the model rather than being produced by the workings of the model itself. See also: endogenous. 407

8 EMPIRICAL PROJECT 7 WORKING IN R Now we will use equations to show the effects of a negative supply shock on your chart from Question 2. Suppose that the supply curve after the shock is: 3 Add the new supply curve to your line chart and interpret the outcomes, as follows: (a) Create a new column in your table from Question 2 called New supply (log P), showing the Supply (log P) after the shock. Make another column called New supply (P) with the converted (base 10) values. (b) Add the New supply (P) values to your line chart and verify that your chart looks as expected. Make sure to label the new supply curve. Consumer and producer surplus are explained in Sections 7.4 ( and 7.9 ( of Economy, Society, and Public Policy. Supply curve: Demand curve: (c) From your chart, what can you say about the change in total surplus, consumer surplus, and producer surplus as a result of the supply shock? (Hint: You may find the following information useful: the old equilibrium point is Q = 5,064, P = 0.22; the new equilibrium point is Q = 3,984, P = 0.27). PART 7.2 INTERPRETING SUPPLY AND DEMAND CURVES You may be wondering why it is useful to express relationships in natural log form rather than in base 10 form. In economics, we do this because there is a convenient interpretation of the coefficients: in the equation Y = a + bx, when both X and Y are in natural logs, then the coefficient represents the elasticity of Y with respect to X. That is, the coefficient is the estimated percentage change in Y for a 1 per cent change in X. To look at the concept of elasticity in more detail, see Section 7.8 ( of The Economy. 1 Use the supply and demand equations from Part 7.1 which are shown here, and carry out the following: (a) Calculate the price elasticity of supply (the percentage change in quantity supplied divided by the percentage change in price). (Hint: You will have to rearrange the equation so that log Q is in terms of log P.) Is the supply price-elastic (in other words, is elasticity greater than 1 in absolute value)? (b) Calculate the price elasticity of demand in the same way. Is the demand price-elastic? Now we will use this information to take a closer look at the model of the watermelon market in the paper and interpret the equations. The paper assumes that farmers decide how many watermelons to grow (supply) based on last season s prices of watermelons and other crops they could grow instead, and the current political conditions that support or limit the amount grown. The reasoning for using last season s prices is that watermelons take time to grow and are also perishable, so farmers cannot wait to see what prices will be in the next season before deciding how many watermelons to plant. 408

9 PART 7.2 INTERPRETING SUPPLY AND DEMAND CURVES The supply equation for watermelons is shown below (this is equation (1) in the paper): Here, CP is a dummy variable that equals 1 if the government cottonacreage-allotment program was in effect ( ). This program was intended to prevent cotton prices from falling by limiting the supply of cotton, so farmers who reduced their cotton production were given government compensation according to the size of their reduction. WW2 is a dummy variable that equals 1 if the US was involved in the Second World War at the time ( ). The dummy variables are used to measure the effects of these exogenous shocks that affected the decisions of farmers growing watermelons. Looking at the supply curves in Figure 7.5, you can see that the dummy variables shift the entire curve by changing the intercept of the supply curve, whereas changes in variables that are part of the model (endogenous variables) would entail a movement along the supply curve. dummy variable (indicator variable) A variable that takes the value 1 if a certain condition is met, and 0 otherwise. You can read more about the government farm programs for cotton during this time period on pages of the report The cotton industry in the United States ( endogenous Produced by the workings of a model rather than coming from outside the model. See also: exogenous Figure 7.5 Supply curve: Dummy variables shift the entire curve (left-hand panel) while changes in endogenous variables move along the curve (right-hand panel). 2 For each variable in the supply equation, give an economic interpretation of the coefficient (for example, explain the effect on the farmers supply decision) and (where relevant) relate the coefficient to an elasticity. Also, with reference to the 95% confidence intervals in Figure 7.6 below, assess the statistical significance of the coefficient. For coefficients on price, assess whether supply is likely to be price elastic (absolute value of coefficient greater than 1) or not. Variable Coefficient 95% confidence interval P (price of watermelons) [0.572, 0.586] C (price of cotton) [ 0.328, 0.314] T (price of vegetables) [ 0.126, 0.122] CP (cotton program) [0.068, 0.077] WW2 (Second World War) [ 0.365, 0.355] Figure 7.6 Supply equation coefficients and 95% confidence intervals. 409

10 EMPIRICAL PROJECT 7 WORKING IN R Now we will look at the demand curve (equation (3) in the paper). The paper specified per capita demand ( ) in terms of price and other variables. ( ) is the demand curve intercept: 3 Using the demand equation and Figure 7.7 below, give an economic interpretation of each coefficient and (where relevant) relate the coefficient to an elasticity. Assess the statistical significance of each coefficient. For coefficients that can be interpreted as elasticities, assess whether the absolute value of the elasticity is significantly different from 1 or not. Variable Coefficient 95% confidence interval P (price of watermelons) [ 1.738, 0.512] Y/N (per capita income) [0.778, 2.722] F (railway freight costs) [ 1.674, 0.262] Figure 7.7 Demand equation coefficients and 95% confidence intervals. Earlier, we mentioned that exogenous supply/demand shocks shift the entire supply/demand curve, whereas endogenous changes (such as changes in price) result in movements along the supply or demand curve. Exogenous shocks that only shift supply or only shift demand come in handy when we try to estimate the shape of the supply and demand curves. Read the information on simultaneity below to understand why exogenous shocks are important to identify the supply and demand curves. simultaneity When the right-hand and left-hand variables in a model equation affect each other at the same time, so that the direction of causality runs both ways. For example, in supply and demand models, the market price affects the quantity supplied and demanded, but quantity supplied and demanded can in turn affect the market price. THE SIMULTANEITY PROBLEM Why we need exogenous shocks that shift only supply or demand In the model of supply and demand, the price and quantity we observe in the data are jointly determined by the supply and demand equations, meaning that they are chosen simultaneously. In other words, the market price affects the quantity supplied and demanded, but the quantity supplied and demanded can in turn affect the market price. In economics we refer to this problem as simultaneity. We cannot estimate the supply and demand curves with price and quantity data alone, because the right-hand-side variable is not independent, but is instead dependent on the left-hand-side variable. Another way to think about this issue is that for every period, the price and quantity we observe is a result of both shifts and/or movements along the supply and demand curves, and we cannot disentangle these shifts or movements of the supply and demand curves without additional information. Figure 7.8 illustrates that there can be many different supply and demand curve shifts to explain the same data. 410

11 PART 7.2 INTERPRETING SUPPLY AND DEMAND CURVES Figure 7.8 Many possible supply and demand curves can explain the data. To address this issue, we need to find an exogenous variable that affects one variable but not the other. That way we can be sure that what we observe is due to a shift in one curve, holding the other curve fixed. In the watermelon market, we used the Second World War as an exogenous supply shock in Part 7.1. The war affected the amount of farmland dedicated to producing watermelons, but arguably did not affect demand for watermelons. Figure 7.9 shows how we can use the exogenous supply shock to learn about the demand curve. The solid line shows the part of the demand curve revealed by the supply shock. Under the assumption that the demand curve is a straight line, we can infer what the rest of the curve looks like. If we had more information, for example if the size of the shock varied in each period, then we could use this information to learn more about the shape of the demand curve (for example, check whether it is actually linear). We use similar reasoning (exogenous demand shocks) to identify the supply curve. 411

12 EMPIRICAL PROJECT 7 WORKING IN R Figure 7.9 Using exogenous supply shocks to identify the demand curve. 4 Given the supply and demand equations in the watermelon model, give two examples of an exogenous demand shock and explain why they are exogenous. 412

13 EMPIRICAL PROJECT 7 SOLUTIONS These are not model answers. They are provided to help students, including those doing the project outside a formal class, to check their progress while working through the questions using the Excel or R walk-throughs. There are also brief notes for the more interpretive questions. Students taking courses using Doing Economics should follow the guidance of their instructors. PART 7.1 DRAWING SUPPLY AND DEMAND DIAGRAMS 1 (a) Solution figure 7.1 shows the two new variables and the actual values of P and Q. (b) Solution figures 7.2 and 7.3 provide line charts for P and Q. 2 (a) Solution figure 7.4 provides the solution, with the solutions to (b) and (c). (b) Solution figure 7.4 provides the solution, with the solutions to (a) and (c). (c) Solution figure 7.4 provides the solution, with the solutions to (a) and (b). (d) Solution figure 7.5 (page 416) shows plotted supply and demand curves. 3 (a) Solution figure 7.5 (page 416) provides the full table with columns added for New supply (log P) and New supply (P). (b) Solution figure 7.7 (page 417) shows the line chart with the additional New supply (P) values plotted. (c) From Solution figure 7.7, we can see that total surplus and consumer surplus have decreased. Producer surplus has also decreased: using a triangle to approximate producer surplus, we can calculate it as before the shock, and after the shock. (Note: A triangle is a reasonable approximation since the supply curves are not far from being linear. However, using triangles to approximate consumer surplus would be a bad idea!) 413

14 EMPIRICAL PROJECT 7 SOLUTIONS Year log (Q) log (P) Q P Solution figure 7.1 Prices and quantities of watermelons (values rounded to two decimal places). Solution figure 7.2 Price of watermelons (USD per 1,000, ). 414

15 PART 7.1 DRAWING SUPPLY AND DEMAND DIAGRAMS Solution figure 7.3 Quantity of watermelons planted (millions, ). Q Log Q Supply (log Q) Demand (log P) Supply (P) Demand (P) , , , , , , , , , , , , , , , , , , , Solution figure 7.4 Calculated prices and quantities (in natural logs and base 10). 415

16 EMPIRICAL PROJECT 7 SOLUTIONS Solution figure 7.5 Supply and demand diagram. Q Log Q Supply (log P) Demand (log P) Supply (P) Demand (P) New supply (log P) New supply (P) , , , , , , , , , , , , , , , , , , , Solution figure 7.6 New supply after the shock. 416

17 PART 7.2 INTERPRETING SUPPLY AND DEMAND CURVES Solution figure 7.7 Supply and demand after a negative supply shock. PART 7.2 INTERPRETING SUPPLY AND DEMAND CURVES 1 (a) We rewrite the supply equation as log Q = log P. The price elasticity of supply is therefore 0.59, which is inelastic (so supply is not very responsive to changes in price). (b) The demand equation can be written as log Q = log P. The price elasticity of demand is therefore 1.22, which is elastic (demand is relatively responsive to changes in price). Note: This data exercise highlights why it is necessary to calculate the elasticities of supply and demand from the data rather than simply looking at the shapes of the supply and demand curves as they appear with the chosen scales for the horizontal and vertical axes. 2 Economic interpretation, elasticity (where relevant), and statistical significance of given coefficients: Price of watermelons: The coefficient is positive, meaning that farmers supply more when the price is higher. The (own) price elasticity of supply is 0.58 and this coefficient is estimated quite precisely (small confidence interval). The confidence interval does not contain 1 so we can conclude that at a 95% level, supply is price inelastic. Price of cotton; price of vegetables: The coefficient is negative. Cotton and vegetables are alternative crops to plant instead of watermelons, so when they become more expensive, farmers will produce fewer watermelons and produce cotton/vegetables instead. However, the cross-price elasticities of supply are both significantly smaller than 1 (in absolute value) so at a 95% confidence level we can conclude that watermelon supply is inelastic with respect to the prices of cotton and vegetables. Cotton program: This program was intended to limit production of cotton (one alternative crop to watermelons). The coefficient 417

18 EMPIRICAL PROJECT 7 SOLUTIONS is positive and the confidence interval does not contain 0, so we can conclude that the policy resulted in some land being dedicated to watermelon production instead. Second World War: This event was a negative supply shock, because some land was dedicated to the war effort instead of watermelon production. The coefficient is negative, significantly different from 0 (at the 95% level), and quite precisely estimated, so we can conclude that the war did have the effect of reducing supply. 3 Economic interpretation, elasticity (where relevant), and statistical significance of given coefficients: Price of watermelons: The own-price elasticity is negative (as expected), but since the confidence intervals are quite wide and contain 1, we cannot conclude that demand is (own) price elastic or not. The confidence interval does not contain 0 so we can at least conclude that demand does respond to changes in price. Per-capita income: Per-capita demand for watermelons increases with income, but again we cannot conclude whether the income elasticity of demand is greater than 1 or not. Railway freight costs: The coefficient is negative, meaning that demand decreases as transportation costs increase (as expected). The 95% confidence interval also does not contain 0. 4 Many possible examples, including: A sudden change in consumers preferences for watermelon: If a medical article is published that extols the benefits of eating watermelons, watermelons may suddenly become a trendy diet food and the demand curve would shift to the right. Demand-side policy changes: A government health initiative that involves subsidies for purchasing any type of fruits would increase the demand for watermelons, shifting the demand curve to the right. 418