MODULE 1.1
READING:
YaRrr Chp 1-6, 9 (Note that the YouTube tutorials do not cover all the reading)
TASK:
Install R and RStudio (YaRrr Chp 2.1-2.2)
Install swirl (https://swirlstats.com/students.html)
Load swirl with library(“swirl”), and start swirl().
Install the R Programming course.
Run through the first module of the R Programming course on swirl (Basic Building Blocks).
Finally, read through and follow the tutorial from YaRrr Chp 2.3 to 4.5. You should perform all the commands in the reading to get a feel for the language.
Submit the task in YaRrr Chp 4.5 down below
Submit your task in a .zip or .7z compressed file, or in a single .R script (not R markdown).
If you’re on MacOS 10 or before, either upgrade to MacOS 11, or if you do not wish to upgrade, try using this RStudio installation instead (the newest version of RStudio on Posit is not compatible with MacOS 10): https://dailies.rstudio.com/version/2021.09.2+382.pro1/
P-Set 1
Remember to document your code well. Report all results in a LaTeX-rendered PDF document. Submit your .R file and your .PDF file in a single compressed folder (.7z, .zip, or .rar).
TASK:
Download the database of NBA players and their signing bonus here. A dictionary for what the variables mean can be found here.
We wish to investigate the contract year phenomenon (https://en.wikipedia.org/wiki/Contract_year_phenomenon).
Write, in the style of an academic research journal article in economics, a description of the data. Include, at the very least:
Report appropriate summary statistics of at least three variables that you consider interesting in the data, including current salary. Discuss your findings. Your summary statistics should at the very least contain all statistics reported by summary().
Report appropriate summary statistics of the overall data. For example, how many unique players are there in the data? (Note that each player may have multiple observations in the data). How many teams are there in the data?
Create a histogram of current salary (use the hist() function). Discuss the distribution of current salary. Ensure that you put the histogram in your document.
What can you say about salaries of NBA players from your answers? Why do you think it follows this distribution?
Write, in the style of an academic research journal article in economics, your analysis of the data. Include:
What are the two variables in the database that you think we should look at to examine whether the contract year phenomenon exists?
Conduct an appropriate two-sample t-test based on your answer to Question 4.1. What does your result tell us? Are your results statistically significant? Do your results demonstrate the existence of a contract year effect?
Conduct an appropriate OLS regression based on your answer to Question 4.1, with appropriate controls. What does your result tell us? Are your results statistically significant? Do your results demonstrate the existence of a contract year effect?