class: center, middle, inverse, title-slide # Introduction to Econometrics ### AECN 896-004 --- class: middle <style type="text/css"> @media print { .has-continuation { display: block !important; } } .remark-slide-content.hljs-github h1 { margin-top: 5px; margin-bottom: 25px; } .remark-slide-content.hljs-github { padding-top: 10px; padding-left: 30px; padding-right: 30px; } .panel-tabs { <!-- color: #062A00; --> color: #841F27; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; padding-bottom: 0px; } .panel-tab { margin-top: 0px; margin-bottom: 0px; margin-left: 3px; margin-right: 3px; padding-top: 0px; padding-bottom: 0px; } .panelset .panel-tabs .panel-tab { min-height: 40px; } .remark-slide th { border-bottom: 1px solid #ddd; } .remark-slide thead { border-bottom: 0px; } .gt_footnote { padding: 2px; } .remark-slide table { border-collapse: collapse; } .remark-slide tbody { border-bottom: 2px solid #666; } .important { background-color: lightpink; border: 2px solid blue; font-weight: bold; } .remark-code { display: block; overflow-x: auto; padding: .5em; background: #ffe7e7; } .hljs-github .hljs { background: #f2f2fd; } .remark-inline-code { padding-top: 0px; padding-bottom: 0px; background-color: #e6e6e6; } .r.hljs.remark-code.remark-inline-code{ font-size: 0.9em } .left-full { width: 80%; height: 92%; float: left; } .left-code { width: 38%; height: 92%; float: left; } .right-plot { width: 60%; float: right; padding-left: 1%; } .left5 { width: 49%; height: 92%; float: left; } .right5 { width: 49%; float: right; padding-left: 1%; } .left3 { width: 29%; height: 92%; float: left; } .right7 { width: 69%; float: right; padding-left: 1%; } .left4 { width: 38%; height: 92%; float: left; } .right6 { width: 60%; float: right; padding-left: 1%; } ul li{ margin: 7px; } ul, li{ margin-left: 15px; padding-left: 0px; } ol li{ margin: 7px; } ol, li{ margin-left: 15px; padding-left: 0px; } </style> <style type="text/css"> .content-box { box-sizing: border-box; background-color: #e2e2e2; } .content-box-blue, .content-box-gray, .content-box-grey, .content-box-army, .content-box-green, .content-box-purple, .content-box-red, .content-box-yellow { box-sizing: border-box; border-radius: 5px; margin: 0 0 10px; overflow: hidden; padding: 0px 5px 0px 5px; width: 100%; } .content-box-blue { background-color: #F0F8FF; } .content-box-gray { background-color: #e2e2e2; } .content-box-grey { background-color: #F5F5F5; } .content-box-army { background-color: #737a36; } .content-box-green { background-color: #d9edc2; } .content-box-purple { background-color: #e2e2f9; } .content-box-red { background-color: #ffcccc; } .content-box-yellow { background-color: #fef5c4; } .content-box-blue .remark-inline-code, .content-box-blue .remark-inline-code, .content-box-gray .remark-inline-code, .content-box-grey .remark-inline-code, .content-box-army .remark-inline-code, .content-box-green .remark-inline-code, .content-box-purple .remark-inline-code, .content-box-red .remark-inline-code, .content-box-yellow .remark-inline-code { background: none; } .full-width { display: flex; width: 100%; flex: 1 1 auto; } </style> <style type="text/css"> blockquote, .blockquote { display: block; margin-top: 0.1em; margin-bottom: 0.2em; margin-left: 5px; margin-right: 5px; border-left: solid 10px #0148A4; border-top: solid 2px #0148A4; border-bottom: solid 2px #0148A4; border-right: solid 2px #0148A4; box-shadow: 0 0 6px rgba(0,0,0,0.5); /* background-color: #e64626; */ color: #e64626; padding: 0.5em; -moz-border-radius: 5px; -webkit-border-radius: 5px; } .blockquote p { margin-top: 0px; margin-bottom: 5px; } .blockquote > h1:first-of-type { margin-top: 0px; margin-bottom: 5px; } .blockquote > h2:first-of-type { margin-top: 0px; margin-bottom: 5px; } .blockquote > h3:first-of-type { margin-top: 0px; margin-bottom: 5px; } .blockquote > h4:first-of-type { margin-top: 0px; margin-bottom: 5px; } .text-shadow { text-shadow: 0 0 4px #424242; } </style> <style type="text/css"> /****************** * Slide scrolling * (non-functional) * not sure if it is a good idea anyway slides > slide { overflow: scroll; padding: 5px 40px; } .scrollable-slide .remark-slide { height: 400px; overflow: scroll !important; } ******************/ .scroll-box-8 { height:8em; overflow-y: scroll; } .scroll-box-10 { height:10em; overflow-y: scroll; } .scroll-box-12 { height:12em; overflow-y: scroll; } .scroll-box-14 { height:14em; overflow-y: scroll; } .scroll-box-16 { height:16em; overflow-y: scroll; } .scroll-box-18 { height:18em; overflow-y: scroll; } .scroll-box-20 { height:20em; overflow-y: scroll; } .scroll-box-24 { height:24em; overflow-y: scroll; } .scroll-box-30 { height:30em; overflow-y: scroll; } .scroll-output { height: 90%; overflow-y: scroll; } </style> # Outline 1. [Ligistics](#logistics) 2. [What is econometrics about?](#econometrics) 3. [Causality and Association](#causality) 4. [Endogeneity](#endogeneity) --- class: inverse, center, middle name: logistics # Logistics <html><div style='float:left'></div><hr color='#EB811B' size=1px width=1000px></html> --- class: middle # Instructors + <span style = "color: red;"> Instructor </span>: Taro Mieno (Office: 209, E-mail: tmieno2@unl.edu) + <span style = "color: red;"> Teaching Assistant </span>: - TBD --- class: middle # Goals of the course + Learn modern introductory econometric theory + Apply econometric theories to real economic problems + Learn how to use statistical software (R) so you can conduct research independently (without technical help from your advisor) - manage data - visualize data - run regressions - interpret results --- class: middle # Text Books ## Recommended: Wooldridge, Jeffrey M. 2006. "Introductory Econometrics: A Modern Approach (<span style = "color: red;">5</span>th edition)." Mason, OH: Thomson/South-Western. --- class: middle # Course Schedule + Lectures (MW): 3:00-4:30pm + Lab sessions (F): 1:00-2:30pm --- class: middle # Course Website [Course Website](https://github.com/tmieno2/MS-Applied-Econometrics) + Lecture Slides + Assignments and submission links + Final paper samples and submission link --- class: middle # Grading + Problem sets (4 assignments): 40% + Small-size midterms (2): 20% + Paper: 40% --- class: middle # Assignments ## Problem sets + Most questions are from the required text book + Some questions come from what we cover in lab sessions ## Rmarkdown to do and submit your problem sets + You are required to present your R codes + You learn how to compile your assignment with your R code written in a document using <span style = "color: red;"> Rmarkdown </span>, which will be covered in the second lab session --- class: middle # Assignments .content-box-red[**Caution**] + 2nd year students have answers to all the questions I will assign (I will use exactly the same problems because they are really good to learn econometrics) + You are free to copy and paste (or rephrase) the answers for your assignment. I won't bother to try to tell if you have copied and pasted answers. + However, you are simply doing dis-service to yourself by depriving yourself of learning opportunities + Moreover, your lack of understanding of the material will be clearly manifested on your performance at midterms and final paper --- class: middle # Midterms In-class open-book midterms + Midterm 1: Oct, 9 (M) + Midterm 2: Nov, 20 (M) --- class: middle # Paper In this assignment, + you write a paper with a particular emphasis on econometric analysis using a real world data set + you are encouraged to use the data set you are using for your masters thesis (talk with your advisor) + you need to ensure that you use a <span style = "color: red;"> panel </span> dataset + No presentation of your final paper --- class: middle # Paper Here is the time line of the paper assignment: + <span style = "color: red;"> Oct, 16 </span>: identify a research topic and the data set you will be using, and get an approval from the instructor + <span style = "color: red;"> Oct, 23 </span>: paper proposal + <span style = "color: red;"> Dec, 15 </span>: final paper --- class: middle # Paper Proposal ## Introduction + clear identification of what you are trying to find out (research question) + why the research question is worthwhile answering ## Simple Model + dependent variable (the variable to be explained) + explanatory variable (variables to be explain) ## Data Source + where you get data --- class: middle # Final Paper ## Introduction + clear identification of what you are trying to find out (research question) [1 point] + why the research question is worthwhile answering [1 point] ## Data description + the nature of the data with summary statistics table [1 point] + visualize a few key variables in a meaningful way [3 points] --- class: middle # Final Paper ## Econometric Methods: the <span style = "color: red;"> process </span> of how you end up with the final econometric models and methods. [40 points (<span style = "color: red;"> or more </span>)] + justification of your choice of independent variables + potential endogeneity problems + what did you do to address the endogeneity problems? + justification of econometric model(s) and method(s) + identify appropriate standard error estimation methods ## Results, Discussions, and Conclusions: + interpret and describe the results [2 points] + implications of the results [1 point] + conclusions [1 point] --- class: inverse, center, middle name: econometrics # What is econometrics about? <html><div style='float:left'></div><hr color='#EB811B' size=1px width=1000px></html> --- class: middle # What econometrics is about .content-box-red[**Econometrics**]: Estimate quantitative relationships between variables .content-box-red[**Examples**]: + the impact of fertilizer on crop yield + the impact of political campaign expenditure on voting outcomes + the impact of education on wage --- class: middle # Steps in Econometric Analysis + formulation of the question of interest (what are you trying to find out?) + develop an economic model of the phenomenon you are interested in understanding (identify variables that matter) + turn the economic model into an econometric model + collect data + <span style = "color: blue;"> estimate the model using econometrics </span> + <span style = "color: blue;"> test hypotheses </span> --- class: middle # Step 2: Develop an economic model .content-box-red[**Example: Job training and worker productivity**] `$$wage = f(educ,exper,training)$$` + `\(wage\)`: hourly wage + `\(educ\)`: years of formal education + `\(exper\)`: years of workforce experience + `\(training\)`: weeks spent in job training .content-box-green[**Note**]: Depending on questions you would like to answer, the economic model can (and should) be much more involved --- class: middle # Step 3: Develop an econometric model `$$wage = f(educ,exper,training)$$` The form of the function `\(f(\cdot)\)` must be specified (almost always) before we can undertake an econometric analysis `$$wage = \beta_0 + \beta_1 educ + \beta_2 exper + \beta_3 training + u$$` ## `\(\beta_0,\beta_1,\beta_2,\beta_3\)` + are the <span style = "color: red;"> parameters </span> of the econometric model. + describe the directions and strengths of the relationship between `\(wage\)` and the factors used to determine `\(wage\)` in the model ## `\(u\)` + is called error term + includes <span style = "color: red;"> ALL </span> the other factors that can affect wage other than the included variables (like innate ability) --- class: middle # Step 4: Collect data + survey + websites + experiment --- class: middle # Data types .content-box-green[**Cross-sectional Data**] + a sample of individuals, households, firms, cities, states, countries, or a variety of other units, taken at a given point in time + the data on all units do not correspond to precisely the same time period - some families surveyed during different weeks within a year --- class: middle # Cross-sectional Data ```r here("Data/wage1.rds") %>% readRDS() %>% data.table() %>% .[, .(wage, educ, exper, female, married)] ``` ``` ## wage educ exper female married ## 1: 3.10 11 2 1 0 ## 2: 3.24 12 22 1 1 ## 3: 3.00 11 2 0 0 ## 4: 6.00 8 44 0 1 ## 5: 5.30 12 7 0 1 ## --- ## 522: 15.00 16 14 1 1 ## 523: 2.27 10 2 1 0 ## 524: 4.67 15 13 0 1 ## 525: 11.56 16 5 0 1 ## 526: 3.50 14 5 1 0 ``` --- class: middle # Data types: Time-series Data .content-box-green[**Time-series Data**] Observations on a variable or several variables over time + corn price + oil price .content-box-red[**Note**]: + The econometric frameworks necessary to analyze time series data are quite different from those for cross-sectional data + We do <span style = "color: red;"> NOT </span> learn time-series econometric methods --- class: middle # Data types: Panel (Longitudinal) Data .content-box-red[**Panel (Longitudinal) Data**] time series data for each cross-sectional member in the data set (<span style = "color: red;"> same </span> cross-sectional units are tracked over a given period of time) .content-box-green[**Example**] + wage data for individuals collected every five years over the past 30 years + yearly GDP data for 60 countries over the past 10 years .content-box-red[**Notes**] + Panel data are much more common than they used to be + Panel data econometric methods take advantage of the panel data structure --- class: middle # Data types: Panel (Longitudinal) Data ```r here("Data/crime4.rds") %>% readRDS() %>% .[, .(county, year, crmrte, prbarr, prbpris)] ``` ``` ## county year crmrte prbarr prbpris ## 1: 1 81 0.0398849 0.289696 0.472222 ## 2: 1 82 0.0383449 0.338111 0.506993 ## 3: 1 83 0.0303048 0.330449 0.479705 ## 4: 1 84 0.0347259 0.362525 0.520104 ## 5: 1 85 0.0365730 0.325395 0.497059 ## --- ## 626: 197 83 0.0155747 0.226667 0.428571 ## 627: 197 84 0.0136619 0.204188 0.372727 ## 628: 197 85 0.0130857 0.180556 0.333333 ## 629: 197 86 0.0128740 0.112676 0.244444 ## 630: 197 87 0.0141928 0.207595 0.360825 ``` --- class: middle # Steps 5 and 6 This is what you learn for the next few months!! + estimate the model using econometrics + test hypothesis --- class: inverse, center, middle name: causality # Causality and Association <html><div style='float:left'></div><hr color='#EB811B' size=1px width=796px></html> --- class: middle # Causality and Association .content-box-red[**Association**] An association of two variables arise because <span style = "color: red;"> either of or both </span> variables affect the other variable `\begin{align} A \longleftrightarrow B \\ A \longrightarrow B \\ A \longleftarrow B \end{align}` Association does <span style = "color: red;"> NOT </span> concern which affects which. Under all the three cases above, A and B are <span style = "color: blue;"> associated</span>. Or, we say there is an association between A and B. This is what <span style = "color: blue;"> correlation coefficient </span> measures. -- .content-box-red[**Causality**] When A has a causal impact on B, `\begin{align} A \longrightarrow B \end{align}` Here, changes in `\(A\)` cause changes in `\(B\)`, not the other way around --- class: middle Let's watch this [interesting CM](https://www.youtube.com/watch?v=KSHMgoUWBmY). --- class: middle .content-box-green[**Claims made in the video**] People who wear glasses are + much smarter than those who don't + more likely to pursue higher education + 200% more likely to graduate college -- For you to be convinced to buy glasses, these claims needs to be causal, not association: + Does wearing glasses make you much smarter? + Does wearing glasses make it more likely for you to pursue higher education? + Does wearing glasses make it 200% more likely for you to graduate college? --- class: middle However, this seems to be a more likely explanation of the association: + One spends more time studying academic subjects - smarter (or knowledgeable) `\(\rightarrow\)` pursue higher education and graduate college - worsened eyesight `\(\Rightarrow\)` wear glasses --- class: middle .content-box-green[**Important**]: + We care about isolating causal effects, but not association + Identifying association is super easy + Identifying causal effects is extremely hard (this is what we tackle) --- class: inverse, center, middle name: endogeneity # Endogeneity: Your Nemesis <html><div style='float:left'></div><hr color='#EB811B' size=1px width=796px></html> --- class: middle # Causality and Association It is super easy to find an association of multiple variables, but it is incredibly hard to find a causal effect (at least in Economics)!! --- class: middle # Endogeneity You are interested in the causal impact of fire fighters on the number of death tolls in fire events <template id="bdb71d18-0ca1-45b5-91f6-ee5516c71cdb"><style> .tabwid table{ border-spacing:0px !important; border-collapse:collapse; line-height:1; margin-left:auto; margin-right:auto; border-width: 0; display: table; margin-top: 1.275em; margin-bottom: 1.275em; border-color: transparent; } .tabwid_left table{ margin-left:0; } .tabwid_right table{ margin-right:0; } .tabwid td { padding: 0; } .tabwid a { text-decoration: none; } .tabwid thead { background-color: transparent; } .tabwid tfoot { background-color: transparent; } .tabwid table tr { background-color: transparent; } </style><div class="tabwid"><style>.cl-c977717a{}.cl-c9729c72{font-family:'Helvetica';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-c972a866{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c972a867{margin:0;text-align:center;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c972d020{width:158.4pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d02a{width:65.8pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d02b{width:65.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d034{width:65.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d035{width:65.8pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d03e{width:158.4pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d03f{width:158.4pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d048{width:65.2pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d049{width:65.8pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d04a{width:158.4pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d052{width:65.2pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c972d053{width:65.8pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c977717a'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c972d053"><p class="cl-c972a866"><span class="cl-c9729c72">fire event</span></p></td><td class="cl-c972d052"><p class="cl-c972a866"><span class="cl-c9729c72">death toll</span></p></td><td class="cl-c972d04a"><p class="cl-c972a866"><span class="cl-c9729c72"># of firefighters deployed</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c972d02a"><p class="cl-c972a867"><span class="cl-c9729c72">1</span></p></td><td class="cl-c972d02b"><p class="cl-c972a867"><span class="cl-c9729c72">10</span></p></td><td class="cl-c972d020"><p class="cl-c972a867"><span class="cl-c9729c72">20</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c972d035"><p class="cl-c972a867"><span class="cl-c9729c72">2</span></p></td><td class="cl-c972d034"><p class="cl-c972a867"><span class="cl-c9729c72">0</span></p></td><td class="cl-c972d03e"><p class="cl-c972a867"><span class="cl-c9729c72">3</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c972d035"><p class="cl-c972a867"><span class="cl-c9729c72">3</span></p></td><td class="cl-c972d034"><p class="cl-c972a867"><span class="cl-c9729c72">5</span></p></td><td class="cl-c972d03e"><p class="cl-c972a867"><span class="cl-c9729c72">10</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c972d035"><p class="cl-c972a867"><span class="cl-c9729c72">4</span></p></td><td class="cl-c972d034"><p class="cl-c972a867"><span class="cl-c9729c72">3</span></p></td><td class="cl-c972d03e"><p class="cl-c972a867"><span class="cl-c9729c72">5</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c972d049"><p class="cl-c972a867"><span class="cl-c9729c72">5</span></p></td><td class="cl-c972d048"><p class="cl-c972a867"><span class="cl-c9729c72">50</span></p></td><td class="cl-c972d03f"><p class="cl-c972a867"><span class="cl-c9729c72">50</span></p></td></tr></tbody></table></div></template> <div class="flextable-shadow-host" id="d8eeefce-6335-4f38-84f9-f20c2d261121"></div> <script> var dest = document.getElementById("d8eeefce-6335-4f38-84f9-f20c2d261121"); var template = document.getElementById("bdb71d18-0ca1-45b5-91f6-ee5516c71cdb"); var caption = template.content.querySelector("caption"); if(caption) { caption.style.cssText = "display:block;text-align:center;"; var newcapt = document.createElement("p"); newcapt.appendChild(caption) dest.parentNode.insertBefore(newcapt, dest.previousSibling); } var fantome = dest.attachShadow({mode: 'open'}); var templateContent = template.content; fantome.appendChild(templateContent); </script> .content-box-green[**Questions**] + How are they associated? + Can you say anything about the causal effect of fire fighters deployment on the number of death tolls? --- class: middle # What happened? You ignored an important variable!! <template id="5b2774ff-8ae8-41ee-aa0c-085f41421f43"><style> .tabwid table{ border-spacing:0px !important; border-collapse:collapse; line-height:1; margin-left:auto; margin-right:auto; border-width: 0; display: table; margin-top: 1.275em; margin-bottom: 1.275em; border-color: transparent; } .tabwid_left table{ margin-left:0; } .tabwid_right table{ margin-right:0; } .tabwid td { padding: 0; } .tabwid a { text-decoration: none; } .tabwid thead { background-color: transparent; } .tabwid tfoot { background-color: transparent; } .tabwid table tr { background-color: transparent; } </style><div class="tabwid"><style>.cl-c9902ce2{}.cl-c98b41c8{font-family:'Helvetica';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-c98b4e52{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c98b4e5c{margin:0;text-align:center;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c98b78e6{width:158.4pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b78fa{width:65.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b78fb{width:65.8pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b7904{width:76.8pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b7905{width:65.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b790e{width:158.4pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b790f{width:76.8pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b7910{width:65.8pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b7918{width:158.4pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b7919{width:65.2pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b791a{width:65.8pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b7922{width:76.8pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b7923{width:158.4pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b792c{width:65.2pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b792d{width:65.8pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c98b7936{width:76.8pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c9902ce2'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c98b792d"><p class="cl-c98b4e52"><span class="cl-c98b41c8">fire event</span></p></td><td class="cl-c98b792c"><p class="cl-c98b4e52"><span class="cl-c98b41c8">death toll</span></p></td><td class="cl-c98b7923"><p class="cl-c98b4e52"><span class="cl-c98b41c8"># of firefighters deployed</span></p></td><td class="cl-c98b7936"><p class="cl-c98b4e52"><span class="cl-c98b41c8">scale of fire</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c98b78fb"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">1</span></p></td><td class="cl-c98b78fa"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">10</span></p></td><td class="cl-c98b78e6"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">20</span></p></td><td class="cl-c98b7904"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">20</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c98b7910"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">2</span></p></td><td class="cl-c98b7905"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">0</span></p></td><td class="cl-c98b790e"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">3</span></p></td><td class="cl-c98b790f"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">5</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c98b78fb"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">3</span></p></td><td class="cl-c98b78fa"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">5</span></p></td><td class="cl-c98b78e6"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">10</span></p></td><td class="cl-c98b7904"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">20</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c98b7910"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">4</span></p></td><td class="cl-c98b7905"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">3</span></p></td><td class="cl-c98b790e"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">5</span></p></td><td class="cl-c98b790f"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">10</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c98b791a"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">5</span></p></td><td class="cl-c98b7919"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">50</span></p></td><td class="cl-c98b7918"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">50</span></p></td><td class="cl-c98b7922"><p class="cl-c98b4e5c"><span class="cl-c98b41c8">100</span></p></td></tr></tbody></table></div></template> <div class="flextable-shadow-host" id="6ec59e48-fa5f-4b5a-b47e-8ae56f0597af"></div> <script> var dest = document.getElementById("6ec59e48-fa5f-4b5a-b47e-8ae56f0597af"); var template = document.getElementById("5b2774ff-8ae8-41ee-aa0c-085f41421f43"); var caption = template.content.querySelector("caption"); if(caption) { caption.style.cssText = "display:block;text-align:center;"; var newcapt = document.createElement("p"); newcapt.appendChild(caption) dest.parentNode.insertBefore(newcapt, dest.previousSibling); } var fantome = dest.attachShadow({mode: 'open'}); var templateContent = template.content; fantome.appendChild(templateContent); </script> --- class: middle # Endogeneity Problem .content-box-green[**Endogeneity (Definition)**]: + Variables of interest are correlated with some <span style = "color: blue;"> unobservables </span> (variables that cannot be observed or are missing) that have non-zero impacts on the variable that you want to explain + The unobserved variables are also called <span style = "color: blue;"> confounder/confounding factor </span>. .content-box-green[**Note**] <span style = "color: blue;"> Confound </span>: mix up (something) with something else so that the individual elements become difficult to distinguish (Oxford dictionary). --- class: middle In the above example, + <span style = "color: red;"> variable of interest </span>: the number of firefighters + <span style = "color: red;"> unobservables/confounder </span>: the scale of fire events (and other factors) + <span style = "color: red;"> variable to explain </span>: death toll -- .content-box-green[**The model**]: `\begin{align} \mbox{death toll} & = \alpha + \beta\; \mbox{# of fire fighters} + \mu\\ ,\mbox{where } \mu & = (\gamma\; \mbox{scale} + v) \mbox{ is the error term (collection of unobservables)} \end{align}` .content-box-green[**Endogeneity Problem**]: \# of fire fighters is correlated with scale, which we ignored --- class: middle .content-box-green[**Another example: education on wage**] `$$wage = \beta_0 + \beta_1 educ + \beta_2 exper + \beta_3 training + u$$` What are unobservables in `\(u\)` that are likely to be correlated with `\(educ\)`? .content-box-red[**An important unobservable**] + innate ability `\(\rightarrow\)` wage + innate ability `\(\rightarrow\)` education --- class: middle Most of the time, you will be faced with endogeneity problems caused by at least one of the followings, + omitted variables (the scale of fire events, innate ability) + self-selection + simultaneity + measurement error -- .content-box-red[**Central Question**] How can we avoid or solve endogeneity problems? --- class: middle # How to deal with endogeneity? + You have two opportunities to deal with endogeneity problems - at the design (design to collect data) stage - at the regression stage (what you will learn in this course) + Econometrics has evolved mostly to address endogeneity problems at the <span style = "color: blue;"> regression stage </span> because randomized experiments are infeasible most of the time + How about econometrics and other fields of statistics: Statistics, Psychometrics, and Biometrics? --- class: middle # How to deal with endogeneity? <template id="9c793ce6-1fbe-4aa4-b3d6-79f1ed2b05ec"><style> .tabwid table{ border-spacing:0px !important; border-collapse:collapse; line-height:1; margin-left:auto; margin-right:auto; border-width: 0; display: table; margin-top: 1.275em; margin-bottom: 1.275em; border-color: transparent; } .tabwid_left table{ margin-left:0; } .tabwid_right table{ margin-right:0; } .tabwid td { padding: 0; } .tabwid a { text-decoration: none; } .tabwid thead { background-color: transparent; } .tabwid tfoot { background-color: transparent; } .tabwid table tr { background-color: transparent; } </style><div class="tabwid"><style>.cl-711ae824{}.cl-7115b6ec{font-family:'Helvetica';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-7115c51a{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-7115e9e6{width:111.6pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7115ea04{width:111.6pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7115ea18{width:104.3pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7115ea22{width:111.6pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7115ea23{width:111.6pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7115ea24{width:104.3pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7115ea2c{width:111.6pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7115ea40{width:104.3pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7115ea41{width:111.6pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-711ae824'><thead><tr style="overflow-wrap:break-word;"><td class="cl-7115ea40"><p class="cl-7115c51a"><span class="cl-7115b6ec">Field</span></p></td><td class="cl-7115ea2c"><p class="cl-7115c51a"><span class="cl-7115b6ec">Design</span></p></td><td class="cl-7115ea41"><p class="cl-7115c51a"><span class="cl-7115b6ec">Estimation Method</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-7115ea18"><p class="cl-7115c51a"><span class="cl-7115b6ec">Econometrics</span></p></td><td class="cl-7115e9e6"><p class="cl-7115c51a"><span class="cl-7115b6ec">not feasible (often)</span></p></td><td class="cl-7115ea04"><p class="cl-7115c51a"><span class="cl-7115b6ec">intricate</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-7115ea24"><p class="cl-7115c51a"><span class="cl-7115b6ec">Many other fields</span></p></td><td class="cl-7115ea23"><p class="cl-7115c51a"><span class="cl-7115b6ec">feasible</span></p></td><td class="cl-7115ea22"><p class="cl-7115c51a"><span class="cl-7115b6ec">relatively simple</span></p></td></tr></tbody></table></div></template> <div class="flextable-shadow-host" id="c0d78187-e967-4bce-ba29-9755a62cd39b"></div> <script> var dest = document.getElementById("c0d78187-e967-4bce-ba29-9755a62cd39b"); var template = document.getElementById("9c793ce6-1fbe-4aa4-b3d6-79f1ed2b05ec"); var caption = template.content.querySelector("caption"); if(caption) { caption.style.cssText = "display:block;text-align:center;"; var newcapt = document.createElement("p"); newcapt.appendChild(caption) dest.parentNode.insertBefore(newcapt, dest.previousSibling); } var fantome = dest.attachShadow({mode: 'open'}); var templateContent = template.content; fantome.appendChild(templateContent); </script> --- class: middle # Deal with endogneity at the design stage .content-box-red[**Randomized Experiments**] + you have a liberty to determine the level of the variable of interest + by randomizing the value of the variable of interest, you can effectively break the link (association) with whatever is included in the error term --- class: middle # The impact of fertilizer on corn yield (Non-Randomized) .content-box-red[**Data**]: Yield and nitrogen rate data obtained from a field that is managed by a farmer <img src="non_randomized.png" width="70%" style="display: block; margin: auto;" /> --- class: middle # The impact of fertilizer on corn yield (Non-Randomized) .content-box-green[**Farmer**] + decide nitrogen rate based on soil/field characteristics (some of them we researchers do not get to observe) .content-box-green[**Researcher**] + soil characteristics is not observable, so it is in the error term `$$yield = \beta_0 + \beta_1 N + (\gamma SC + \mu)$$` + N (nitrogen rate) and SC (soil characteristics) are correlated --- class: middle # The impact of fertilizer on corn yield (Non-Randomized) Suppose the farmer applied more nitrogen to the area where its soil characteristics lead to higher corn yield .content-box-green[**Question**] If the researcher estimate the model (which ignores soil characteristics), do you over- or under-estimate the impact of nitrogen rate on corn yield? --- class: middle # Randomized Experiments <img src="Introduction_x_files/figure-html/unnamed-chunk-8-1.png" width="70%" style="display: block; margin: auto;" /> .content-box-red[**Important**] Soil quality (in error term) is no longer correlated with N!! --- class: middle # Randomized Experiments on Education? .content-box-red[**Randomized Experiment?**]: Researchers determine randomly how much education subjects (people) can get? --- class: middle # Endogeneity Problem in Economics + Economics is about understanding human behavior -- + Almost always, you need to deal with endogeneity problem because people are `smart`: we make decisions based on available information (not just randomly) so that our decisions lead to good outcomes (<span style = "color: blue;">whether our decisions turn out to be good or not is irrelevant</span>) - how much education one get is determined based on their judgment of their own ability (not by rolling a dice) - how many fire fighters to be deployed was determined based on the scale of fire (not by rolling a dice) - how much nitrogen to apply based on soil characteristics (not by rolling a dice) -- + If people are not smart and just roll a dice for their decision making, we would have much easier time identifying causal effects