This README documents Zander Prinsloo’s (20065124) answers to the Data Science test on Monday 24 May 2021. It describes how I go about answering the three questions of the test, and also gives those answers in the sections below. The sections are appropriately named Question 1, Question 2, and Question 3.
Note, however, that there are also sub-folders for each question. These also have their own projects. Within those folders you will find, amongst other things, a) pdfs with the answers to the relevant questions, b) a code folder that contains specific code and functions used in answering that question. The latter are sourced into this README.
Here is the code for how I created this folder, specifically the 20065124.Rproj and corresponding folders, as well as the sub-directories for each question.
# Create the project - This is all commented out now.
# LOCATION <- c("/Users/zanderprinsloo/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Desktop – MacBookPro’s MacBook Pro/Academic/Postgraduate/Masters/Modules/Data Science/Test")
# fmxdat::make_project(FilePath = LOCATION,
# ProjNam = "20065124",
# Mac = T)
# # Create Projects for each question including Texevier template
# Texevier::create_template(directory = paste0(LOCATION, "/20065124"),
# template_name = "Question1")
# Texevier::create_template(directory = paste0(LOCATION, "/20065124"),
# template_name = "Question2")
# Texevier::create_template(directory = paste0(LOCATION, "/20065124"),
# template_name = "Question3")
This section provides the answers for Question 1. Before answering the
question I need to a) do garbage collection, b) load important packages,
c) source relevant code from the Question1/code
. This is done the
separate chunks below.
Garbage Collection:
## used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
## Ncells 1032771 55.2 2046882 109.4 NA 1720798 92
## Vcells 1817880 13.9 8388608 64.0 16384 2747585 21
I will seek to prove that movie critics were not a near perfect prediction of a film’a popularity and profitability amongst audiences in the mid-2000s. In order to do that I use the Movies.csv data set given to me by my friend at Mr Video. I will try to disprove her claims using plots throughout.
She claims that: :if a movie had a rating of more than 80% on Rotten Tomatoes, audiences would rate it above 85% every time."
The barplot below clearly shows that my friend’s claim is false. For the films that Rotten Tomatoes rated above 80, an overwhelming majority was not rated above 85 by audiences.
The second claim is that “Disney films may not have the highest grossing numbers, but they’ve always been the most profitable of all the leading studios.”
I will show that they have not always been the most profitable out of the leading studios.
There is one film called Fireproof that has a very high profitability of 66.934. It is an outlier that will be excluded from the plot along with any missing values of profitability or studios.
## # A tibble: 1 x 8
## Film Genre `Lead Studio` `Audience score … Profitability `Rotten Tomatoes…
## <chr> <chr> <chr> <dbl> <dbl> <dbl>
## 1 Firepr… Drama Independent 51 66.9 40
## # … with 2 more variables: Worldwide Gross <dbl>, Year <dbl>
In we see that Disney is not clearly the most profitable film. While it’s median is very close to Fox, Sony, and Summit, it’s upper quintile is substantially lower than Summit. Note also that Disney is being pulled up by an outlier, High School Musical 3: Senior Year
If we remove this outlier, we get . It shows that Disney is an average performer in terms of Profitability. It’s median is lwoer than Fox, and its upper quintile appears lower than Fox, Sony, Summit, and Universal Studios.
Therefore, it is not clear that Disney is indeed more profitable. The plots indicate that there are a number of studios that are more profitable and more consistent.
The third claim is that “Audiences are always drawn to the highest grossing films”. She goes further to claim that the correlation between world wwide grossing numbers and audience scores would be near 80%.
Note that gives the relationship between world wide gross and audience rating. The linear line is shows what a strong correlation would look like. However, the actual line plot of the relationship between world wide gross and audience scores is much more jagged and sporadic. There is not a clear linear relationship and correlation. This means that the third claim also appears false.
Some interesting findings using the Forbes data set
This plot in shows that there is a surprisingly high requency of rich people with (‘Common’) names John, Mike/Michael, James, or Bill. Similarly, there are quite a number of families that make up the Billionaires on Forbes’ list.
For this question I will give a barplot to show the composition of tweets that use photos and videos for the different media outlets
Now I do a similar plot to compare the quantity of hashtags