movies_master <- movies %>%
mutate(Runtime..Minutes. = case_when(
Runtime..Minutes. == 1 ~ 60,
Runtime..Minutes. == 2 ~ 120,
Runtime..Minutes. == 3 ~ 180,
Runtime..Minutes. == 4 ~ 240,
TRUE ~ Runtime..Minutes.
))BAIS 462 Final Project
The Movies
I have always been fascinated with cinema, but not in the typical sense of “fascination”. When I’m watching a movie with my friends, I often cannot help but wonder how much work went into its production. I wonder how much others enjoy the film, what their honest assessment of the movie is, how much did this movie earn, etc. I cannot escape these questions when I watch any movie.
I suppose this interest is more of the behind the scenes “magic”. This infamous Hollywood magic has transformed entertainment as we know it, but I am interested in why that is. Do certain variables in a movie make them more likeable, or earn larger sums of money? I want to find out what factors contribute to making movies more money and better ratings.
Data
I found a dataset from Kaggle that had lots of information about tons of different movies.
These are the variables in the dataset and a brief description of what they are:
| Variable | Description |
|---|---|
| Title | Name of the movie |
| Summary | A description of the movie and its events |
| Director | The name of the Director/Directors |
| Writer | Name of the Writer/Writers |
| Main.Genres | Genres of the movie |
| Motion.Picture.Rating | Movie Rating |
| Release.Year | Year the movie was released |
| Runtime..Minutes. | Length of the movie in minutes |
| Rating..Out.of.10. | Average reviewer rating score out of 10 |
| Number.of.Ratings..in.thousands. | Number of ratings given to movie in thousands |
| Budget..in.millions. | Amount of money spent on making the movie |
| Gross.in.US…Canada..in.millions. | Gross amount of money earned in US and Canada in millions |
| Gross.worldwide..in.millions. | Gross amount of money earned worldwide in millions |
| Opening.Weekend.in.US…Canada | The date of the movie’s opening weekend in the US and Canada |
| Gross.Opening.Weekend..in.millions. | Gross amount of money earned in millions worldwide in the movie’s opening weekend |
There is an issue with the Runtime..Minutes. variable, as any movie whose runtime is at an exact hour mark shows the runtime as the hour amount, not the minutes amount (exactly 1 hour long = 1, when it should be 60, 2 hours long = 2, when it should be 120, etc.). Therefore, we need to tweak that variable.
Summary Statistics
| Variable | Minimum | Maximum | Median | Mean |
|---|---|---|---|---|
| Release.Year | 1915 | 2027 | 2010 | 2004.142 |
| Runtime..Minutes. | 41 | 607 | 105 | 108.7627 |
| Rating..Out.of.10. | 1.3 | 10 | 6.5 | 6.46613 |
| Gross.worldwide..in.millions. | 0 | 2923.706 | 23.838 | 87.12246 |
Some of these are very interesting. The median and mean for the release year being as recent as they are (given how long movies have been made for) show just how many more movies are being released in recent years, as well as in the near future. The maximum runtime in the dataset is over 10 hours long! After doing some digging, I found that this movie is actually 10 hours of paint drying. Sounds like a great time! The median and mean for rating out of 10 is around 6.5 for both. This is very interesting to me, as I would expect them to be closer to 5, as one may expect that to be the score for the “average” film. This also shows that people likely view 5 as a bad score, not an average one, which is not what I would expect given the scale. I suppose people are just too nice. The mean for gross movie earnings is far higher than the median, which shows how much the huge outliers affect the data.
Analysis
The first question I have is how the rating of a movie, or what ages the movie is appropriate for, affects the reviewer rating of a movie. As I have gotten older, most people that I know typically like to watch movies meant for more mature audiences. In order to test this, we should make a visualization comparing these. I am going to compare the three most common movie ratings: PG, PG-13, and R.
ggplot(subset(movies_master, Motion.Picture.Rating %in% c("PG", "PG-13", "R")),
aes(x = Motion.Picture.Rating, y = Rating..Out.of.10.)) +
geom_boxplot() +
labs(title = "Movie Rating Compared to Reviewer Rating",
x = "Movie Rating",
y = "Rating (Out of 10)")Warning: Removed 88 rows containing non-finite values (`stat_boxplot()`).
We can see that there actually is not much of a difference between the three ratings, as they are all reviewed fairly similarly.
Now, we will look at how the movie’s rating compares to the runtime. It would make sense if the more mature movies are longer than the less mature ones, as nobody expects children to sit through a long film.
ggplot(subset(movies_master, Motion.Picture.Rating %in% c("PG", "PG-13", "R")),
aes(x = Motion.Picture.Rating, y = Runtime..Minutes.)) +
geom_boxplot() +
labs(title = "Movie Rating Relationship with Runtime",
x = "Movie Rating",
y = "Runtime(Minutes)")Warning: Removed 17 rows containing non-finite values (`stat_boxplot()`).
Interestingly there is not too much of a difference yet again. PG-13 movies seem slightly longer than the other two, but not significantly longer. It is also intriguing to see the outliers of the very long movies, as there are some that are over 3 1/2 hours long!
For the next visualization, I want to see how reviewer rating and runtime match up with each other. I wonder if there is some sort of “sweet spot”, where the movie is not too long or too short. I will exclude all datapoints from movies that are over 5 hours long, as those are pretty extreme outliers.
ggplot(subset(movies_master, Runtime..Minutes. <= 300),
aes(x = Runtime..Minutes., y = Rating..Out.of.10.)) +
geom_point() +
geom_smooth(method = "loess") +
labs(title = "Relationship between Runtime and Rating",
x = "Runtime (Minutes)",
y = "Rating")`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 132 rows containing non-finite values (`stat_smooth()`).
Warning: Removed 132 rows containing missing values (`geom_point()`).
The very first thing to point out in this graph is the shape of the regression curve. When movies are from roughly 1 1/2 hours long to 3 hours long there is a positive relationship in reviewer rating, where there is a negative relationship everywhere else. This is that sweet spot mentioned earlier. Not many people want to sit through a movie any longer than 3 hours, while movies shorter than 90 minutes hardly even feel like a movie at all.
I now want to see the relationship between reviewer rating and worldwide earnings. One would expect that high-earning movies would be well received by those who watch them.
ggplot(movies_master, aes(x = Rating..Out.of.10., y = Gross.worldwide..in.millions.)) +
geom_point() +
geom_smooth(method = "loess") +
labs(title = "Relationship between Rating and Worldwide Earnings",
x = "Rating",
y = "Gross Earnings (Millions)")`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 1956 rows containing non-finite values (`stat_smooth()`).
Warning: Removed 1956 rows containing missing values (`geom_point()`).
There seems to be a slight increase in gross earnings as the reviewer rating increases. An uptick of this positive relationship occurs when the reviewer rating is about 7.5.
It seems like all of the highest earning movies came out fairly recently. Luckily, we can test this theory.
ggplot(movies_master, aes(x = Release.Year, y = Gross.worldwide..in.millions.)) +
geom_point() +
geom_smooth(method = "loess") +
labs(title = "Relationship between Release Year and Worldwide Earnings",
x = "Release Year",
y = "Gross Earnings (Millions)")`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 1955 rows containing non-finite values (`stat_smooth()`).
Warning: Removed 1955 rows containing missing values (`geom_point()`).
While there is a slight increase over time, the regression line shows a negative relationship between release year and worldwide earnings starting around 2010. However, this is due to the fact that so many more movies have been made recently. Not that many of them earn much money, so this causes the negative relationship between release year and worldwide earnings starting in 2010.
Next, I wonder how runtime affects worldwide earnings. People may not go see a movie if they find it too long, and if it is too short they may deem it not to be worth the money.
ggplot(movies_master, aes(x = Runtime..Minutes., y = Gross.worldwide..in.millions.)) +
geom_point() +
geom_smooth(method = "loess") +
labs(title = "Relationship between Runtime and Worldwide Earnings",
x = "Runtime (Minutes)",
y = "Gross Earnings (Millions)")`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 1959 rows containing non-finite values (`stat_smooth()`).
Warning: Removed 1959 rows containing missing values (`geom_point()`).
There is a positive relationship between runtime and worldwide earnings until movies get around 3 1/2 hours long. When movies are this long, they do not tend to earn as much money as shorter films.
Lastly, we will check how movie runtimes have changed over the years. Are movies longer now than ever before? Have they progressively gotten longer?
ggplot(movies_master, aes(x = Release.Year, y = Runtime..Minutes.)) +
geom_point() +
geom_smooth(method = "loess") +
labs(title = "Relationship between Release Year and Runtime",
x = "Release Year",
y = "Runtime (Minutes)")`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 166 rows containing non-finite values (`stat_smooth()`).
Warning: Removed 166 rows containing missing values (`geom_point()`).
The average movie has seemingly always been right around 2 1/2 hours long. It is interesting to see that there has not really been any change in this, as it has been the case for roughly 100 years.
Sentiment
Now I want to look at how the summaries of Batman Begins and Man of Steel compare to reviews of those films. There is a summary column in the dataset I have, and I scraped data from IMDb to get reviews from the two movies listed.
movie_counts %>%
group_by(Title) %>%
mutate(n = ifelse(sentiment == "negative", -n, n)) %>%
mutate(word = reorder(word, n)) %>%
ggplot(aes(word, n)) +
geom_col() +
coord_flip() +
facet_wrap(~Title, ncol = 2) +
geom_text(aes(label = signif(n, digits = 3)), nudge_y = 8) +
labs(title = "Positive and Negative Words for Brief Summaries of Batman Begins and Man of Steel")While there were not many words to work from, it is interesting to see that Batman Begins has no words with positive value in the movie’s summary. This speaks largely of the character of Batman, as everything is supposed to be dark and hopeless. Man of Steel having one positive and one negative word makes sense, as Superman tries to be a symbol of hope in hard times, so a mixed sentiment of the summary is to be expected.
When we compare the summary sentiment to the review sentiment, we get a much different picture.
hero_counts %>%
group_by(Title) %>%
filter(n>5) %>%
mutate(n = ifelse(sentiment == "negative", -n, n)) %>%
mutate(word = reorder(word, n)) %>%
ggplot(aes(word, n)) +
geom_col() +
coord_flip() +
facet_wrap(~Title, ncol = 2) +
geom_text(aes(label = signif(n, digits = 3)), nudge_y = 8) +
labs(title = "Positive and Negative Words from Reviews of Batman Begins and Man of Steel",
subtitle = "Only words appearing at least 5 times are shown")When thinking about how a person that is reviewing a movie would write about it, one would talk more about their enjoyment and main takeaways from the movie rather than the plot. This is why there is such a big difference in the type of words between the two.
Conclusion
While movies may not be the same as they used to be, the industry is definitely thriving in its own way. More films are being made now than ever, and there is still tons of interest. Looking at different variables about movies and doing analysis of them gives me much more clarity about what sort of things are important for the success of movies. It is also important to note that summarizing movies and reviewing movies are not the same, as reviewing a movie is far more emotional than summarizing one. All-in-all, my interest and passion for movies is still very high, but I am fortunate to be more informed about them than I was before.