econometrics-with-r

Difference in Difference

效應評估模型 “提高最低工資是否會減少就業?” “最低工資提高是否餐廳的全職員工數會減少?” 假設 $MinWage$為「最低工資有提高」的虛擬變數

Panel Data

效應評估模型 \[ mrall=mrall_{-BeerTax}+\beta^*BeerTax \] 提高啤酒稅(BeerTax)是否有助減低車禍死亡率(mrall)? 固定效應模型 令 $W$代表「州愛喝酒程度」。 $W$與 $mr

Linear Regression

OLS estimator The method to compute (or estimate) $b_0$ and $b_1$ we illustrated above is called Ordinary Least Squares, or OLS. $b_0$ and $b_1$ are therefore also often called the OLS coefficients. By solving problem \[ \begin{align} e_i & = y_i - \hat{y}_i = y_i - \underbrace{\left(b_0 + b_1 x_i\right)}_\text{prediction}\\ e_1^2 + \dots + e_N^2 &= \sum_{i=1}^N e_i^2 \equiv \text{SSR}(b_0,b_1) \\ (b_0,b_1) &= \arg \min_{\text{int},\text{slope}} \sum_{i=1}^N \left[y_i - \left(\text{int} + \text{slope } x_i\right)\right]^2 \end{align} \]

工具变量

效應評估模型 \[Y_{i}={Y}_{-p,i}+\beta_i P_{i}\] \[ Y_i=Y_{-P,i}+\beta^* P_i \] \[ \begin{equation} Y_i=\beta_0+\beta_1P_i+w_i'\gamma+\varepsilon \tag{3.2} \end{equation} \] 在$w_{i}$條件下,「香煙售價」$P_{i}$必需要與「非價格效應的香煙銷售量」$Y_{-P}$獨立