Linaer regression ============================================================== In this section, we will review regression from a statistical perspective. For a machine learning perspective, see the machine learning section. The main goal is to find the best line that fits the data. For instance, consider the following figures constructed using World Bank data. .. |pic1| image:: /Courses/images/gdp-ruralpop.jpg :width: 45% .. |pic2| image:: /Courses/images/gdp-co2.jpg :width: 45% |pic1| |pic2| The problem in each dataset consists of finding a linear approximation :math:`\hat{y}_{i}` of the true value :math:`y_{i}`, where the error is measured as :math:`u_{i}^{2} = (y_{i} - \hat{y}_{i})^{2}`. .. math:: :nowrap: \begin{equation} \min_{\beta_{0}, \beta_{1}} \sum u_{i}^{2} \end{equation} .. |pic3| image:: /Courses/images/gdp-ruralpop-fit.jpg :width: 45% .. |pic4| image:: /Courses/images/gdp-co2-fit.jpg :width: 45% |pic3| |pic4| Here, we see that the values :math:`\beta_{0}` and :math:`\beta_{1}` that solve the problem can be obtained using two methods: **Maximum Likelihood Estimation** and the **Least Squares Method**. Both methods yield similar results. Slides ---------------------------------------------------------------------------------------- .. list-table:: Notebooks :widths: 10 20 :header-rows: 1 * - Model - Material * - Introduction to linear regression - `Slides `_ * - Linear regression notebook - `Notebook lr `_ * - Excercise linear regression - `Notebook excercise lr `_ * - Introduction to dummy variables - `Dummy variables slides `_ * - Multicollinearity - `Notebook `_ * - Assumptions - `Slides assumptions `_ * - Assumptions - `Notebook assumptions `_ * - Especification - `Notebook especification `_ Videos *********************************************************** * `Bivariate - OLS `_ Laboratories ******************************************************** * `Cobb-Douglas production function `_ * `Cobb-Douglas production function II `_ * `Instrumental variables `_ * `Regularization `_ Impacto ----------------------------------------------------- * * `Intro diff and diff and PSM `_