Lecture 1 This is a work in progress!
1.1 Set up
Welcome to the “Mostly Handsdirty Metrics” course! In this course, you will learn how to use the R programming language to analyze large and complex data sets, with a focus on applications in economics. You will gain a solid understanding of key concepts and techniques in data manipulation, visualization, and statistical analysis, and you will have the opportunity to apply these skills to real-world data sets. By the end of the course, you will be well-equipped to conduct your own independent research and analysis using big data in economics. We look forward to working with you and helping you succeed in this exciting field!
Grading in this course will be based on a combination of individual assignments, group projects, and exams. Individual assignments will typically consist of problem sets and other exercises designed to help you apply the concepts and techniques covered in class. Group projects will provide the opportunity for you to work collaboratively on a more substantial research or analysis task, using real data and applying the methods and techniques you have learned. Exams will be used to assess your overall understanding of the course material and your ability to apply it in new situations.
In addition to completing the assignments and exams, attendance and having a laptop are also mandatory in this course. Attendance is important because the course material will be presented in a dynamic and interactive manner, and you will have the opportunity to ask questions and engage with the material in real time. Having a laptop is also essential, as you will need it to access the course materials, complete assignments, and participate in class activities. You will be expected to bring your laptop to every class, and to have it fully charged and ready to use.
1.2 Why R?
We are using R in this course because it is a powerful and versatile programming language that is well-suited for working with large datasets. R has a rich ecosystem of libraries and packages that make it easy to perform complex data analysis tasks, such as data cleaning, visualization, and statistical modeling. Additionally, R is a free and open-source software, so you can easily install and use it on your own computer without incurring any costs. Overall, R is an excellent choice for working with big data in economics and will provide you with the skills and tools you need to succeed in this course.
1.3 Why RStudio?
RStudio is an integrated development environment (IDE) for R. It provides a user-friendly interface for working with R and includes a number of features that make it easier to write and run R code. In this course, we will be using RStudio to write and execute R code, as well as to create reports and other documents that use R output. RStudio provides a convenient way to organize and manage your R projects, and its features can help you work more efficiently and effectively with R. Additionally, RStudio is free and open-source, so it is a cost-effective choice for students and researchers. By using RStudio, you will be able to take full advantage of the capabilities of R and apply them to your economic analysis of big data.
1.4 Installing R
To install R on your computer, you will first need to determine your operating system. R is available for Windows, MacOS, and Linux. Once you know your operating system, follow these instructions:
For Windows: go to the R website (https://cran.r-project.org/) and click on the “Download R for Windows” link. This will download the latest version of R for Windows. Once the download is complete, double-click on the downloaded file to begin the installation process. Follow the on-screen instructions to complete the installation. See a video tutorial here [https://youtu.be/NZxSA80lF1I].
For MacOS: go to the R website (https://cran.r-project.org/) and click on the “Download R for (Mac) OS X” link. This will download the latest version of R for MacOS. Once the download is complete, double-click on the downloaded file to begin the installation process. Follow the on-screen instructions to complete the installation. See a video tutorial here [https://youtu.be/cCgiR1uwXzU]
For Linux: R is typically included in the package repositories for most Linux distributions. To install R, open a terminal window and type the following command: sudo apt-get install r-base. This will install the latest version of R on your Linux system.
Once R is installed, you can launch it by typing R at the command prompt (for Windows and Linux) or by opening the R application (for MacOS). This will bring up the R console, where you can type R commands and run them.
Note: If you encounter any difficulties during the installation process, consult the R website (https://cran.r-project.org/) for detailed instructions and troubleshooting tips. Additionally, you can search online for help or ask for assistance on forums and other online communities.
1.5 Installing RStudio
To install RStudio on your computer, you will first need to have R installed. If you have not yet installed R, follow the instructions in the previous response to install it on your operating system. Once R is installed, you can install RStudio by following these instructions:
For Windows: go to the RStudio website (https://www.rstudio.com/) and click on the “Download” button. This will take you to the download page, where you can click on the “Download RStudio Desktop” button to download the latest version of RStudio for Windows. Once the download is complete, double-click on the downloaded file to begin the installation process. Follow the on-screen instructions to complete the installation.
For MacOS: go to the RStudio website (https://www.rstudio.com/) and click on the “Download” button. This will take you to the download page, where you can click on the “Download RStudio Desktop” button to download the latest version of RStudio for MacOS. Once the download is complete, double-click on the downloaded file to begin the installation process. Follow the on-screen instructions to complete the installation.
For Linux: RStudio is available as a binary package for most Linux distributions. To install RStudio, open a terminal window and type the appropriate command for your Linux distribution. For example, on Ubuntu and other Debian-based systems, you can use the following command to install RStudio: sudo apt-get install rstudio.
Once RStudio is installed, you can launch it by double-clicking on the RStudio icon or by typing rstudio at the command prompt (for Windows and Linux). This will open the RStudio application, where you can create new R projects and start working with R.
Note: If you encounter any difficulties during the installation process, consult the RStudio website (https://www.rstudio.com/) for detailed instructions and troubleshooting tips. Additionally, you can search online for help or ask for assistance on forums and other online communities.