install.packages("tidyverse")
install.packages("readxl")
install.packages("janitor")
install.packages("estimatr")Practice Problem Set 1: Introduction
Downloading R and R Studio/Positron
If you don’t have R and R Studio/Positron downloaded, please download them:
If you prefer to use RStudio, please create an R project for this class and open that project. Try using the project setup. If using Positron, you don’t need to create a project but you can just set up a folder for this course.
Install the following packages:
Working In R
Open an R script.
Look at the
sleepdata, which is a built in dataset in R.sleepextra group ID 1 0.7 1 1 2 -1.6 1 2 3 -0.2 1 3 4 -1.2 1 4 5 -0.1 1 5 6 3.4 1 6 7 3.7 1 7 8 0.8 1 8 9 0.0 1 9 10 2.0 1 10 11 1.9 2 1 12 0.8 2 2 13 1.1 2 3 14 0.1 2 4 15 -0.1 2 5 16 4.4 2 6 17 5.5 2 7 18 1.6 2 8 19 4.6 2 9 20 3.4 2 10Using the
summary()function from base R, write code to look at the summary of all the variables in the data.Using the
table()function, check the how many records are there for eachgroup.Run a linear regression regressing
extraongroupand view the summary of the model.
Working with Quarto
Download Quarto. Create an
htmlQuarto document and write a short paragraph on what you expect to gain out of this course in the next 3 months.In the document, check where the working directory is now.
Create code snippets on the Quarto document and transfer the code from Question 4 through 8 there.
Render the html file.
Bonus: Version Control
If you don’t have a GitHub account, create an account.
Create a repository for this class and add the R Project you created for this class to the repository.
Commit and push changes to remote repository.