Announcements The first midterm is a week from today It will be in - - PowerPoint PPT Presentation

announcements
SMART_READER_LITE
LIVE PREVIEW

Announcements The first midterm is a week from today It will be in - - PowerPoint PPT Presentation

Announcements The first midterm is a week from today It will be in class and similar in format to the old exams on Smartsite Bring a calculator, something to write with and a scantron sheet (UCD 2000) There will be a formula sheet (its


slide-1
SLIDE 1

Announcements

The first midterm is a week from today It will be in class and similar in format to the old exams

  • n Smartsite

Bring a calculator, something to write with and a scantron sheet (UCD 2000) There will be a formula sheet (it’s posted on Smartsite so you can see what is on it) It will cover everything up to and including univariate data transformation (Chapters 1 through 4) I’ll have extra office hours next week: Monday 2pm - 5pm, Tuesday 2pm - 5pm (no office hours on Thursday after the exam)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 1 / 39

slide-2
SLIDE 2

Schedule

Week of Tuesday Thursday January 3 lecture lecture January 10 lecture lecture January 17 lecture lecture January 24 lecture Midterm 1 January 31 lecture lecture February 7 lecture lecture February 14 lecture lecture February 21 lecture Midterm 2 February 28 lecture lecture March 7 lecture lecture Final Exam: Thursday March 17, 10:30am-12:30pm

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 2 / 39

slide-3
SLIDE 3

Univariate Data Transformation

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 3 / 39

slide-4
SLIDE 4

Why Use Data Transformations?

We transform data to make it easier to recognize patterns and easier to interpret results We have very natural ways of thinking about certain aspects of data such as percent changes It may be easier to see a growth rate from a graph of the log of GDP than of GDP in dollars We often care about one component of the variation in data but not others

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 4 / 39

slide-5
SLIDE 5

Economists’ Favorite Data Transformations

There are a variety of data transformations that economists routinely use Time series data on variables measured in terms of a particular currency are often transformed from nominal to real values When growth rates are of interest, we often transform data using the natural logarithm We often convert macroeconomic data into per capita terms We often try to remove certain trends from data, for example doing seasonal adjustments

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 5 / 39

slide-6
SLIDE 6

The Natural Logarithm

1 2 ‐2 ‐1 1 2 0.5 1 1.5 2 2.5 3 ln(x) ‐6 ‐5 ‐4 ‐3 ‐2 ‐1 1 2 0.5 1 1.5 2 2.5 3 ln(x) ‐6 ‐5 ‐4 ‐3 ‐2 ‐1 1 2 0.5 1 1.5 2 2.5 3 ln(x)

y = ln(x) x = ey

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 6 / 39

slide-7
SLIDE 7

The Natural Logarithm

The big thing about the natural logarithm is that it has a special derivative: d ln(x) dx = 1 x Why is this special? Think about calculating a percent change: %∆x = ∆x x Now think about calculating a change in ln(x): ∆ ln(x) ≈ d ln(x) dx · ∆x ∆ ln(x) ≈ 1 x · ∆x ∆ ln(x) ≈ %∆x

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 7 / 39

slide-8
SLIDE 8

The Natural Logarithm

So we can calculate percent changes by looking at the change in the natural log of x Why is this any better than just calculating percent changes the old-fashioned way? Think about a graph of GDP over time:

The slope of the graph is the change in GDP per year This will be big if GDP is big whether or not the growth rate is big

Now think about a graph of ln(GDP) over time:

The slope is now the change in ln(GDP) per year This is the percent change in GDP per year (the annual growth rate of GDP)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 8 / 39

slide-9
SLIDE 9

Japan’s GDP and Population Growth

500000 600000 Nominal GDP (billions of yen) 200000 300000 400000 500000 600000 Nominal GDP (billions of yen) Population (in thousands) 100000 200000 300000 400000 500000 600000 1952 1962 1972 1982 1992 Nominal GDP (billions of yen) Population (in thousands) 100000 200000 300000 400000 500000 600000 1952 1962 1972 1982 1992 Nominal GDP (billions of yen) Population (in thousands)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 9 / 39

slide-10
SLIDE 10

Japan’s GDP and Population Growth

13 14 10 11 12 13 14 ln(nominal GDP) ln(population) 8 9 10 11 12 13 14 1952 1962 1972 1982 1992 ln(nominal GDP) ln(population) 8 9 10 11 12 13 14 1952 1962 1972 1982 1992 ln(nominal GDP) ln(population)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 10 / 39

slide-11
SLIDE 11

A Few Things to Remember with Logs

In Excel, natural logs can be calculated using the LN() function If a graph of ln(xi) produces a straight line, the variable has a constant growth rate The slope gives the growth rate in terms of ’percent per t’ where t is the unit of time used (for example, if time is in years a slope of .05 means a 5% per year growth rate) You can’t take the log of a negative number (redefine your variable to make the observations positive)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 11 / 39

slide-12
SLIDE 12

Converting from Nominal to Real

Inflation is a problem for any time series variable we look at measured in dollars (or any other currency) A dollar in 1909 is different than a dollar in 2009 We really care about how much a person can purchase This is why we convert from nominal values to real values

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 12 / 39

slide-13
SLIDE 13

Converting from Nominal to Real

The basic idea is to convert everything into a single year’s currency We can do this with a price index Each year t has a particular price index pt To convert something measured in year t dollars to year t + n dollars, you divide by pt and multiply by pt+n For example, the consumer price index (CPI) for 1958 was 28.9 and the CPI for 2008 was 215.3. So if a person earned $10 a day in 1958, that would be the equivalent of earning: $10 · 215.3 28.9 = $74 a day in 2008 dollars.

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 13 / 39

slide-14
SLIDE 14

Converting from Nominal to Real

To convert a nominal data series to a real data series, first obtain a data series for a price index

www.bls.gov has data on the most common price indices for US data www.measuringworth.org has a wider variety of price indices for historical data

Copy the price index data into your spreadsheet so the values match up with the appropriate years Construct a new variable using the following formula: xt ∗ CPIT/CPIt where xt is the nominal value observed in year t, CPIt is the price index for the year t, and CPIT is the price index value for the base year T Keep track of the base year you decide to use To Excel for an example with postage stamp prices...

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 14 / 39

slide-15
SLIDE 15

The Cost of Sending a Letter

60

Price of a first class stamp

30 40 50 ents 10 20 C Current year cents (nominal) 2009 cents (real) 1885 1890 1895 1900 1905 1910 1915 1920 1925 1930 1935 1940 1945 1950 1955 1960 1965 1970 1975 1980 1985 1990 1995 2000 2005

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 15 / 39

slide-16
SLIDE 16

Japan’s GDP Growth Again

13 14 10 11 12 13 14 ln(nominal GDP) ln(real GDP) 8 9 10 11 12 13 14 1952 1962 1972 1982 1992 ln(nominal GDP) ln(real GDP) 8 9 10 11 12 13 14 1952 1962 1972 1982 1992 ln(nominal GDP) ln(real GDP)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 16 / 39

slide-17
SLIDE 17

Some Cautionary Notes

No single price index is perfect What people buy changes over time The quality of products changes over time Prices vary not only across time but across place It is important to choose the best price index for your specific data and to understand its limitations

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 17 / 39

slide-18
SLIDE 18

Inflation’s Components

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 18 / 39

slide-19
SLIDE 19

CPI-U For Different Cities

130 135 CPI‐U (San Francisco) CPI U (Atlanta) 110 115 120 125 130 135 CPI‐U (San Francisco) CPI‐U (Atlanta) CPI‐U (Anchorage) 95 100 105 110 115 120 125 130 135 1999 2003 2007 CPI‐U (San Francisco) CPI‐U (Atlanta) CPI‐U (Anchorage)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 19 / 39

slide-20
SLIDE 20

Converting to Per Capita Terms

Economies are different sizes Two economies with the same GDP shouldn’t be thought of as identical if one has twice as many people as the other To make aggregate numbers more meaningful, we often convert into per capita terms Examples: per capita, per person, per 1,000, birth rate, homicide rate, etc. Calculation is easy: divide by the number of people in the population of interest

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 20 / 39

slide-21
SLIDE 21

Japan’s GDP Growth One Last Time

y = 0.0522x + 10.956 0 0085 11 388 12 14 16 y = 0.0522x + 10.956 y = 0.0085x + 11.388 8 10 12 14 16 y = 0.0522x + 10.956 y = 0.0437x + 6.4753 y = 0.0085x + 11.388 4 6 8 10 12 14 16 ln(real GDP) y = 0.0522x + 10.956 y = 0.0437x + 6.4753 y = 0.0085x + 11.388 2 4 6 8 10 12 14 16 ln(real GDP) ln(real GDP per capita) ln(population) y = 0.0522x + 10.956 y = 0.0437x + 6.4753 y = 0.0085x + 11.388 2 4 6 8 10 12 14 16 1952 1962 1972 1982 1992 ln(real GDP) ln(real GDP per capita) ln(population) y = 0.0522x + 10.956 y = 0.0437x + 6.4753 y = 0.0085x + 11.388 2 4 6 8 10 12 14 16 1952 1962 1972 1982 1992 ln(real GDP) ln(real GDP per capita) ln(population)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 21 / 39

slide-22
SLIDE 22

CO2 Emissions Around the World

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 22 / 39

slide-23
SLIDE 23

CO2 Emissions per Capita Around the World

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 23 / 39

slide-24
SLIDE 24

CO2 Emissions per GDP Around the World

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 24 / 39

slide-25
SLIDE 25

Other Ways We Normalize Data

Dividing by the population size is just one of many ways to normalize data We may want to divide by a more specific set of people We may want to divide by GDP or total expenditures Dividing by land area is quite common The key is to transform the variable so that it can be used for whatever comparison we actually want to make

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 25 / 39

slide-26
SLIDE 26

Moving Averages and Seasonal Adjustment

Data often has high frequency trends and low frequency trends Often times, we are only interested in one of these two trends If we want to focus on long term trends, we often do an average to get rid of high frequency fluctuations A T period simple moving average: ˜ xt = xt + xt−1 + ... + xt−(T−1) T A centered moving average: ˜ xt = xt−2 + xt−1 + xt + xt+1 + xt+2 5

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 26 / 39

slide-27
SLIDE 27

Moving Averages and Seasonal Adjustment

Using the averaged data will smooth out the data series and allow you to focus on long term trends

Good for looking at long run growth Helps minimize effects of business cycles, seasonality on data

Subtracting the averaged data from the original data will leave you with the high frequency variation net of the long term trend

Good if you want to focus on the seasonality or cyclical nature of the data Used when we want to look at deviations from the

  • verall trend
  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 27 / 39

slide-28
SLIDE 28

The Unemployment Rate

10 12 e Seasonally Adjusted Unemployment Rate Unadjusted 2 4 6 8 10 12 Unemployment Rate Seasonally Adjusted Unemployment Rate Unadjusted Unemployment Rate 2 4 6 8 10 12 Unemployment Rate Seasonally Adjusted Unemployment Rate Unadjusted Unemployment Rate 2 4 6 8 10 12 Unemployment Rate Seasonally Adjusted Unemployment Rate Unadjusted Unemployment Rate

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 28 / 39

slide-29
SLIDE 29

The Unemployment Rate

9 10 6 7 8 9 10 Unemployment Rate 4 5 6 7 8 9 10 Jan 1990 Jul 1990 Jan 1991 Jul 1991 Jan 1992 Jul 1992 Jan 1993 Jul 1993 Unemployment Rate 4 5 6 7 8 9 10 Jan 1990 Jul 1990 Jan 1991 Jul 1991 Jan 1992 Jul 1992 Jan 1993 Jul 1993 Unemployment Rate

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 29 / 39

slide-30
SLIDE 30

The Unemployment Rate

10 12 Seasonally Adjusted Unemployment Rate 2

Unadjusted u - Adjusted u

4 6 8 10 12 Unemployment Rate Seasonally Adjusted Unemployment Rate Unadjusted Unemployment Rate 0.5 1 1.5 2

Unadjusted u - Adjusted u

2 4 6 8 10 12 Unemployment Rate Seasonally Adjusted Unemployment Rate Unadjusted Unemployment Rate ‐1 ‐0.5 0.5 1 1.5 2

Unadjusted u - Adjusted u

2 4 6 8 10 12 Unemployment Rate Seasonally Adjusted Unemployment Rate Unadjusted Unemployment Rate ‐1 ‐0.5 0.5 1 1.5 2

Unadjusted u - Adjusted u

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 30 / 39

slide-31
SLIDE 31

Analyzing Bivariate Data

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 31 / 39

slide-32
SLIDE 32

Bivariate Data

Most economic questions are framed in terms of the effect of one variable on another Some common questions dealing with bivariate data:

What is the relationship between the inflation rate and the unemployment rate? Are there gender differences in wages? How does education influence health? How do tax rates influence labor supply?

Bivariate data lets us (try to) answer these types of questions

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 32 / 39

slide-33
SLIDE 33

Notation for Bivariate Data

The big difference is that now we have two random variables instead of one The standard way to refer to the two random variables is with X and Y

X: covariate, explanatory variable, independent variable, right-hand-side (RHS) variable, regressor Y : dependent variable, outcome, or left-hand-side (LHS) variable

An observation is written as (xi, yi) for cross-section data or (xt, yt) for time series data

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 33 / 39

slide-34
SLIDE 34

Notation for Bivariate Data

The choice of which variable is our independent variable and which variable is our dependent variable depends on what kind of causality we have in mind Causality is assumed to run from X to Y The direction of causality is typically clear from our economic theory but often can’t be tested Our methods/statistics typically capture associations, not causal relationships Need some sort of experiment to determine causation (change X holding other things constant)

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 34 / 39

slide-35
SLIDE 35

Visual Representations of Bivariate Data

The most common way to depict bivariate data is with a scatter plot Each observation is single point on the graph x values are given by the horizontal axis, y values are given by the vertical axis In Excel, select the columns containing your x and y values and choose ’Scatter’ from the Insert menu A trend line can be added by right clicking on a data point on the graph and selecting ’Add trendline...’ We’ll go through an example using data on life expectancy and GNP (gnp-life-expectancy.csv)...To Excel...

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 35 / 39

slide-36
SLIDE 36

Interpreting Scatter Plots

The most basic thing we can see on a scatter plot is whether there is a positive or negative relationship between the two variables (or no relationship) We can also see how strong the relationship is by how closely the datapoints follow a line Including the trendline can help pick out the sign of a very weak relationship Sometimes the relationship between two variables is much easier to see on the graph if you transform one or both of the variables (ln(x), √y, etc.) and by adjusting the scales Take note of any obvious extreme outlier points, often times these can be a result of incorrectly coded data or unobserved values being coded as 99 or something similar

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 36 / 39

slide-37
SLIDE 37

Scatter Plot Examples

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 37 / 39

slide-38
SLIDE 38

Scatter Plot Examples

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 38 / 39

slide-39
SLIDE 39

Scatter Plot Examples

  • J. Parman (UC-Davis)

Analysis of Economic Data, Winter 2011 January 20, 2011 39 / 39