the log linear model
play

The Log-Linear Model The flu example from last class is actually one - PowerPoint PPT Presentation

The Log-Linear Model The flu example from last class is actually one of our most common transformations called the log-linear model : ln Y = 1 + 2 X + We can use ordinary least squares to estimate b 1 and b 2 : ln y i = b 1 + b 2 x i


  1. The Log-Linear Model The flu example from last class is actually one of our most common transformations called the log-linear model : ln Y = β 1 + β 2 X + ε We can use ordinary least squares to estimate b 1 and b 2 : � ln y i = b 1 + b 2 x i Remember that a change in logs is roughly equal to the percentage change (as a decimal): 100 · b 2 = 100 · ∆ln y = %∆ y ∆ x ∆ x J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 1 / 35

  2. The Linear-Log Model Another variation using logs is the linear-log model: Y = β 1 + β 2 ln X + ε We can use ordinary least squares to estimate b 1 and b 2 : y i = b 1 + b 2 ln x i ˆ Interpreting b 2 : 1 100 · ∆ ln x = ∆ y ∆ y 100 b 2 = %∆ x J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 2 / 35

  3. The Linear-Log Model 90 85 fe expectancy at birth 80 75 y = 0.001x + 62.78 70 R² = 0.377 65 60 55 50 50 Li 45 40 0 5000 10000 15000 20000 25000 30000 Consumption per capita Data are for the year 2000 from the World Development Indicators dataset. J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 3 / 35

  4. The Linear-Log Model 90 85 fe expectancy at birth 80 75 70 65 y = 5.663x + 26.19 60 R² = 0.696 55 50 Lif 45 40 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5 ln(Consumption per capita) Data are for the year 2000 from the World Development Indicators dataset. J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 4 / 35

  5. The Log-Log Model Our last variation using logs: ln Y = β 1 + β 2 ln X + ε We can use ordinary least squares to estimate b 1 and b 2 : � ln y i = b 1 + b 2 lnx i Interpreting b 2 : b 2 = 100 · ∆ ln y 100 · ∆ ln x = %∆ y %∆ x J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 5 / 35

  6. The Log-Log Model 60 a O2 emissions per capita 50 50 y = 0.000x + 2.257 40 R² = 0.281 30 20 CO 10 0 0 5000 10000 15000 20000 25000 30000 Consumption per capita Data are for the year 2000 from the World Development Indicators dataset. J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 6 / 35

  7. The Log-Log Model 5 y = 0.918x ‐ 6.029 4 4 R² = 0.687 emissions per capita) 3 2 1 0 ‐ 1 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5 ln(CO2 e ‐ 2 ‐ 3 ‐ 4 ‐ 5 ln(Consumption per capita) Data are for the year 2000 from the World Development Indicators dataset. J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 7 / 35

  8. When to Use Logs Log-linear model: Useful when the underlying relationship between x and y is exponential (population growth, education and wages, etc.) Linear-log model: Useful when x is on a very different scale for different observations (when the independent variable is county population, income, etc.) Log-log model: Useful when both x and y are on very different scales for different observations or when calculating elasticities Logs are useful in general whenever it makes sense to think of percent changes in a variable J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 8 / 35

  9. Another Example of Data Transformation A general pattern of wages over the life cycle is that they rise early in your working career and then fall off at the end of your career For this reason, economists often think that a linear model is not a good way to model wages or income as a function of age Instead, wages (or ln(wages)) are often regressed on a polynomial of age J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 9 / 35

  10. Another Example of Data Transformation U.S. Life-Cycle Wage Profiles Wage (normalized to 1 on average) 1.2 1.1 1.0 .9 .8 .7 .6 .5 .4 17 22 27 32 37 42 47 52 57 62 67 Age SOURCE: Cross-sectional data based on 1990 U.S. Census, as reported in Kjetil Storesletten (1995). J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 10 / 35

  11. Another Example of Data Transformation Regressing ln(income) on a quadratic in age: ln y i = b 1 + b 2 · age i + b 3 · age 2 i How do we interpret the coefficients? d ln y dage = b 2 + 2 b 3 · age The effect of an additional year of age on income varies with age J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 11 / 35

  12. Polynomial Transformations Quadratic model: Y = β 1 + β 2 X + β 3 X 2 + ε Using a polynomial of order p : Y = β 1 + β 2 X + β 3 X 2 + ... + β p +1 X p + ε These are multivariate linear models that can still be estimated with ordinary least squares They are useful when there is a nonlinear but smooth relationship between x and y J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 12 / 35

  13. Interpreting the Coefficients Let’s focus on interpreting the coefficients in the quadratic case The change in y associated with a change in x of one unit will depend on the magnitude of x Suppose we are looking at age as our independent variable and log income as our dependent variable and estimate b 2 equal to 0.10 and b 3 equal to -0.001 In this case, log income is increasing in age ( b 2 > 0) but at a decreasing rate ( b 3 < 0) J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 13 / 35

  14. Interpreting the Coefficients J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 14 / 35

  15. Interpreting the Coefficients J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 15 / 35

  16. Categorical Variables So far, our analysis has focused on numerical variables Another case where we have to transform the data is when we have categorical variables Suppose I have data on ice cream sales and the month of the year My data points would look like ($1500 , July ) I can’t just regress ice cream sales on month What if I just convert month to a number, January equals 1, February equals 2, etc.? Doesn’t work, these numbers don’t have any real meaning so a change in y resulting from a change in month number isn’t meaningful J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 16 / 35

  17. Categorical Variables Solution: dummy variables Dummy variables are a way to transform categorical variables into a set of binary variables In the ice cream example, we could define a dummy variable for “summer months”: summer = 1 if month ∈ ( June , July , August ) summer = 0 otherwise Now we can regress ice cream sales on this dummy: sales = b 1 + b 2 · summer Notice that if it is a non-summer month, predicted sales are equal to b 1 while if it is a summer month, predicted sales are equal to b 1 + b 2 So b 2 captures the additional sales associated with summer months relative to non-summer months J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 17 / 35

  18. Categorical Variables Our general model with a dummy variable: Y = β 1 + β 2 D where D is equal to 1 if a certain condition holds and zero otherwise We can get estimates b 1 and b 2 by regressing y i on x i : y i = b 1 + b 2 d i ˆ Interpreting results: y ( d = 0) = b 1 ˆ ˆ y ( d = 1) = b 1 + b 2 y ( d = 1) − ˆ ˆ y ( d = 0) = b 2 J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 18 / 35

  19. A Review of Bivariate Data Transformation Recall that the point of bivariate data transformation was to get our data into a form where the dependent variable is a linear function of the independent variable Examples of data transformation: taking natural logs (log-linear, linear-log, log-log), using polynomials, creating dummy variables How to know a transformation is needed: Economic intuition (eg. percent changes make sense) Scatter plot reveals a nonlinear relationship Observations can be on very different scales (income, population, etc.) J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 19 / 35

  20. A Review of Bivariate Data Transformation ���� �� ������ ���� ��������� ��� ��������� �� ��� �� ����� ��������� ��������� �������� ���� ����� � �������� � �� �� ���� ��� ���� ��� ������������� ����� ���� � �� ��� ����� ���� ��� ��� From the Bulletin of the World Health Organization, 1999, 77 (10) J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 20 / 35

  21. A Review of Bivariate Data Transformation Notice that deaths from influenze have a U-shape for 1892 It would make sense to use a quadratic to estimate the relationship between age and influenza deaths For 1918 it’s a bit more complicated, there is the U-shape but an additional peak in the late-20s It would still make sense to use a polynomial but you’ll want more terms J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 February 10, 2011 21 / 35

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend