class: center, middle, inverse, title-slide .title[ # Module 0: Getting Started ] .subtitle[ ## Part 1: Class Overview and Software Setup ] .author[ ### Ian McCarthy | Emory University ] .date[ ### Econ 470 & HLTH 470 ] --- <!-- Adjust some CSS code for font size, maintain R code font size --> <style type="text/css"> .remark-slide-content { font-size: 30px; padding: 1em 2em 1em 2em; } .remark-code, .remark-inline-code { font-size: 20px; } </style> <!-- Set R options for how code chunks are displayed and load packages --> # Motivating question **Does health care spending improve health?** ??? Let's motivate the course with this simple question...does health care spending improve our health? --- # Spending and Health ```r ggplot(data = (dartmouth.data %>% filter(Year==2015)), mapping = aes(x = Expenditures, y = Total_Mortality)) + geom_point(size = 1) + theme_bw() + scale_x_continuous(label = comma) + geom_smooth(method="lm", se=FALSE, color="blue", size=1/2) + labs(x = "Spending Per Capita ($US)", y = "Mortality Rate", title = "Mortality and Health Care Spending") ``` .plot-callout[ <img src="00-1-setup_files/figure-html/dartmouth-callout-1.png" style="display: block; margin: auto;" /> ] --- # Spending and Health <img src="00-1-setup_files/figure-html/dartmouth-output-1.png" style="display: block; margin: auto;" /> ??? This shows a positive relationship between health care spending and mortality. So health care spending is actually negatively correlated with health. What does this mean? --- # Spending and Health - Does medical spending make us sicker? - What else might explain this relationship? .plot-callout[ <img src="00-1-setup_files/figure-html/dartmouth-callout-1.png" style="display: block; margin: auto;" /> ] ??? Sicker people are more likely to need health care. So in this simple graph, we're actually picking up the fact that sicker people are more likely to die. In econometrics, this problem goes by a few names, such as endogeneity or selection. --- # Goals of this course. 1. Understand and implement selected methods for causal inference -- <br> 2. Along the way...data management and version control with real data -- <br> 3. Summarize, visualize, and explain research results <!-- New Section --> --- class: inverse, center, middle name: syllabus # Syllabus highlights <html><div style='float:left'></div><hr color='#EB811B' size=1px width=1055px></html> (Read the full document [here](https://imccart.github.io/econ470-content/syllabus-spring2023/syllabus.pdf).) --- # Why this course? 1. Major problems that need solutions 2. Need good, convincing empirical work for policy 3. Working with data is hard, particularly health care data 4. Your work should be transparent and reproducible --- # Structure - Very applied in nature - *Methods* for causal inference - Selection on observables (regression, re-weighting, matching, propensity scores) - Instrumental variables - Regression discontinuity - Difference-in-differences --- # Structure - *Substantive* areas - Hospital pricing, policy, and competition - Cigarette taxes and demand - Medicare Advantage and quality disclosure - Medicaid expansion and health insurance --- # Structure - *Datasets* from the real world - Hospital Cost Report Information System (HCRIS) - Centers for Disease Control (CDC) - Medicare Advantage data - Behavioral Risk Factor Surveillance System (BRFSS), Medicaid, Health Insurance Exchanges --- # Assignments - Homework (x5) - Policy brief - Participation --- # Grading | Component | Weight | |:-|-:| | 5 × homework assignments (12% each) | 60% | | Final project | 36% | | Participation | 4% | <!-- New Section --> --- class: inverse, center, middle name: software # Software Installation <html><div style='float:left'></div><hr color='#EB811B' size=1px width=1055px></html> --- # Software Installation 1. Download [R](https://www.r-project.org/) 2. Download [RStudio](https://www.rstudio.com/products/rstudio/download/preview/) 3. Download [Git](https://git-scm.com/downloads) 4. Create an account on [GitHub](https://github.com/) -- For help and troubleshooting with Git and GitHub, take a look at Jenny Bryan's http://happygitwithr.com. --- # Checklist <html>☑</html> Do you have the most recent version of R? ```r version$version.string ``` ``` ## [1] "R version 4.2.2 Patched (2022-11-10 r83330)" ``` <html>☑</html> Do you have the most recent version of RStudio? (The [preview version](https://www.rstudio.com/products/rstudio/download/preview/) is fine.) ```r RStudio.Version()$version ## Requires an interactive session but should return something like "[1] ‘1.4.1717’" ``` <html>☑</html> Have you updated all of your R packages? ```r update.packages(ask = FALSE, checkBuilt = TRUE) ``` --- # Checklist - Open up the [shell](http://happygitwithr.com/shell.html#shell) - Windows users, make sure that you installed a Bash-compatible version of the shell. If you installed [Git for Windows](https://gitforwindows.org), then you should be good to go. --- # Checklist <html>☑</html> Which version of Git have you installed? ```r git --version ``` <html>☑</html> Did you introduce yourself to Git? (Substitute in your details.) ```r git config --global user.name 'Ian McCarthy' git config --global user.email 'ian.mccarthy@emory.edu' git config --global --list ``` <html>☑</html> Did you register an account in GitHub? <!-- New Section --> --- class: inverse, center, middle name: git_rstudio # Practice with Git and RStudio <html><div style='float:left'></div><hr color='#EB811B' size=1px width=1055px></html> --- # Before next class (see http://happygitwithr.com) 1. Download [R](https://www.r-project.org/) 2. Download [RStudio](https://www.rstudio.com/products/rstudio/download/preview/) 3. Download [Git](https://git-scm.com/downloads) 4. Create an account on [GitHub](https://github.com/) 5. Connect RStudio to Git and GitHub 6. Start/clone/fork a repository for this class --- # Setting things up Now we're going to clone a GitHub repository (repo) using RStudio. The video below is from Grant McDermott's class. <center> <iframe width="600" height="350" src="https://raw.githack.com/uo-ec607/lectures/master/02-git/02-Git.html#15" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> </center> --- # Some common mistakes for windows users - Windows folders are *not* files...there is no content without a file. You can't commit or push changes without content. - Let RStudio/GitHub create the directory (main folder) for you. - If you're working across devices on your own repo, be sure to pull before starting and push afterward. - Avoid spaces in file names. Avoid them at all costs. *DO NOT PUT SPACES IN YOUR FILE NAMES.* >*"A space in a file name is a space in your soul."* --- # Ideal workflow Until you are a Git(Hub) expert... 1. Start project on GitHub (fork from another repo if needed) 2. Clone to desktop with RStudio 3. See http://happygitwithr.com for instructions on linking your local repo with a new upstream remote