\documentclass[10pt]{article}
 
\usepackage{amsmath} 
\usepackage{amsfonts} 
\usepackage{amssymb}
\usepackage{amsthm}
%\usepackage{setspace}
\usepackage{fullpage}
\usepackage{hyperref}

\usepackage{graphicx}
\usepackage{listings}
\usepackage{color}

\newcommand{\indep}{\perp\!\!\!\perp}
\newcommand{\argmax}{\operatornamewithlimits{arg\,max}}
\newcommand{\argmin}{\operatornamewithlimits{arg\,min}}
\newcommand{\plim}{\operatornamewithlimits{plim}}
\newcommand{\citefull}[1]{\citename{#1} \citeyear{#1}}
\newcommand{\cov}{\text{cov}}
\newcommand{\var}{\text{Var}}
\newcommand{\rank}{\text{rank}}
\def\inprobLOW{\rightarrow_p}
\def\inprobHIGH{\,{\buildrel p \over \rightarrow}\,} 
\def\inprob{\,{\inprobHIGH}\,} 
\def\indist{\,{\buildrel d \over \rightarrow}\,} 


% defined environments
\newtheorem{thm}{Theorem} %[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}

\theoremstyle{remark}
\newtheorem{rem}[thm]{Remark}
\newtheorem{ex}[thm]{Example}

\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}


\title{14.32 Recitation 5}
\author{Paul Schrimpf}

\begin{document}

\maketitle{}

\begin{itemize}
\item Problem set 2 solutions
\item Difference in log $\approx$ percent change
\item Regression overview
\end{itemize}

\section{Difference in logs $\approx$ percent change} 
We have stated in class many times that the difference in logs is an
approximate percent change.  Let's see exactly why that is.  First,
we'll just think about comparing the average of logs between two
groups.  After that, we'll think about regression with the dependent
variable in logs.  Let $\beta = E[\log y_1] - E[\log y_2]$.  The basic
idea is that:
\begin{align*}
  \beta \approx e^\beta - 1 \approx \frac{E[y_1]}{E[y_0]} - 1
\end{align*}
The first $\approx$ comes from a Taylor expansion of $e^\beta$ around
$\beta = 0$.  That is,
\begin{align}
  e^\beta = 1 + \beta + \frac{\beta^2}{2} + o(\beta^2)
\end{align}
It will be more accurate the smaller $\beta$ is.  The second $\approx$
comes from saying that $\exp\left(E[\log y_1] - E[\log y_0] \right)
\approx \frac{E[y_1]}{E[y_0]}$.  This approximation is exact when
there is no variance in $y_1$ and $y_0$ and when
$\frac{E[y_1]}{E[y_0]} = \frac{e^{E[\log y_1]} - E[y_1]}{e^{E[\log
      y_0]} - E[y_0]}$.  The later would be the case when $y_0$ and
$y_1$ have the same type of distribution but one is rescaled.  For
example, if $y_0 \sim Exp(\lambda)$ and $y_1 \sim Exp(a\lambda)$

In summary, $\beta = E[\log y_1] - E[\log y_0] \approx \frac{E[y_1] -
  E[y_0]}{E[y_0]}$ and this approximation is better (i) the smaller
$\beta$ is and (ii) the closer $e^{E[\log y_k]}$ is to $E[y_k]$.  

The following table shows the quality of the approximation $\beta
\approx e^\beta -1$ as a function of $\beta$: \\
\begin{tabular}{c| cccccccc}
  \hline
  $\beta$ & 0 &  0.01 &  0.05 &  0.1 &  0.2 &  0.3 &  0.4 &  0.5 \\
  $e^\beta - 1$ & 0 &  0.01 &  0.051 &  0.11 &  0.22 &  0.35 &  0.49 &  0.65 \\
  Error & 0 &  5e-05 &  0.0013 &  0.0052 &  0.021 &  0.05 &  0.092 &
  0.15 \\ \hline
\end{tabular}
\\
In general, the log approximation understates the percent change.

\paragraph{Regression with Logs} 
When you estimate a regression with dependent variable in logs, say 
\[ \log y = \alpha + x \beta + \epsilon \]
Then $\beta$ is the approximate percent change in $E[y|x]$ per unit
change in $x$.  The reason is exactly that given above.  

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Regression overview}

These are some important facts about regression.  Some we have already
seen, others we will cover soon.  I'll go through some of the details
in recitation.
\begin{itemize}
\item Population regression: $\min_{\alpha,\beta} E\left[ (y - \alpha
  - x\beta)^2 \right]$ gives $\alpha =  E[Y] - \beta E[X]$ and $\beta =
  \frac{COV(X,Y)}{V(X)}$ 
\item Best linear approximation to CEF: population regression also
  solve $\min_{\alpha,\beta} E\left[ (E[y|x] - \alpha - x\beta)^2
  \right]$
\item Sample regression: $\min_{\alpha,\beta} \sum (y_i - \alpha - x_i
  \beta)^2$ gives $\hat{\alpha} = \bar{y} - \hat{\beta} \bar{x}$,
  $\hat{\beta} = \frac{\sum (y_i - \bar{y})(x_i - \bar{x}) }{\sum
    (x_i - \bar{x})^2 }$
\item Variance of OLS: $V(\hat{\beta}) = \frac{\sigma_{\epsilon}^2}{n s_x^2}$
\item Gauss-Markov theorem: under the classical regression
  assumptions, OLS is the best linear unbiased estimator.  That is
  among all estimators that are linear in $y$, $\tilde{\beta} = \sum
  z_i y_i$ where $z_i$ is potentially some function of $x$ and
  unbiased, $E[\tilde{\beta}] = \beta$, OLS has the smallest variance.
\item Firsch-Waugh Theorem / partialing out: the following are
  equivalent ways to estimate $\hat{\beta}_1$
  \begin{itemize}
  \item Multiple regression: $\min_{\alpha,\beta_1,\beta_2} \sum (y_i
    - \alpha - x_{i1}\beta_1 - x_{i2} \beta_2)^2$
  \item Partial out $x_{i2}$: regress $y$ on $x_2$, call the residuals
    $\hat{e}_y$.  Regress $x_1$ on $x_2$, call the residuals
    $\hat{e}_x$.  Regress $\hat{e}_y$ on $\hat{e}_x$.  The coefficient
    on $\hat{e}_x$ is $\hat{\beta}_1$.
  \end{itemize}
\end{itemize}

\end{document}
