<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/imdb-movie-analysis/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://sw23993.wordpress.com/2017/01/19/imdb-movie-analysis/"> Environmental Science and Data Analytics</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Movies of late haven’t impressed (this viewer anyhow) and I keep finding myself returning to classics of the 1980’s and 1990’s to get my movie fix. While browsing through <a target="_blank" rel="nofollow" href="https://www.kaggle.com/">Kaggle </a>datasets, I came across the IMDB 5000 Movie Dataset which contains data on over 5000 movies scraped from the IMDB website. I dove into the data to see what I could find.</p>
<h2>Directors of the Top 10 Grossing Movies</h2>
<p>James Cameron’s “Titanic” leads the way with gross earnings of $658 672 302. This movie is, of course, one of the most well known of all time but what other movies are amongst the top earners? We see Colin Trevorrow’s “Jurassic World”, Joss Whedon’s “The Avengers” and James Cameron’s “Avatar” have also done very well at the box office. Other directors in this top tier are George Lucas (Star Wars: Episode I – The Phantom Menace, Star Wars: Episode IV – A New Hope), Christopher Nolan (The Dark Knight, The Dark Night Rises) and Andrew Adamson (Shrek 2).</p>
<p>I must admit, it pleases me greatly to see the sci-fi genre doing so well. Apart from “Titanic” and “Shrek 2”, the top earning movies are all sci-fi. The barplot below is stacked when a director has more than one movie in this top 10 gross earnings subset. We see James Cameron takes the number one slot as the director of the movies with the highest gross earnings. I can’t believe that I still haven’t seen “Titanic”.</p>
<p> </p>
<p><img sizes="(max-width: 739px) 100vw, 739px" data-image-description="" data-orig-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot2.png?w=456&amp;ssl=1" data-orig-size="788,414" data-image-title="rplot" class="wp-image-382" data-comments-opened="1" data-recalc-dims="1" data-attachment-id="382" data-permalink="https://sw23993.wordpress.com/2017/01/19/imdb-movie-analysis/rplot-3/" alt="rplot" data-medium-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot2.png?w=456&amp;ssl=1?w=300" data-large-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot2.png?w=456&amp;ssl=1?w=739" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot2.png?w=456&ssl=1"></p>
<h2></h2>
<h2>Top Actors/Actresses</h2>
<p>What does the distribution of lead actors/actresses look like in the top 10 grossing movies subset? Chris Hemsworth tops the list for his role as Thor in “The Avengers” and “Avengers: Age of Ultron”. There are just two females in the list, one of which is CCH Pounder who starred in “Avatar”. Leonardo DiCaprio (Titanic), Bryce Dallas Howard (Jurassic World), Christian Bale (The Dark Night), Natalie Portman (Star Wars: Episode I – The Phantom Menace), Harrison Ford (Star Wars: Episode IV – A New Hope), Tom Hardy (The Dark Knight Rises) and Rupert Everett (Shrek 2) make up the rest of the field.</p>
<p> </p>
<p><img sizes="(max-width: 739px) 100vw, 739px" data-image-description="" data-orig-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot011.png?w=456&amp;ssl=1" data-orig-size="788,414" data-image-title="rplot01" data-comments-opened="1" class="wp-image-402" data-recalc-dims="1" data-attachment-id="402" data-permalink="https://sw23993.wordpress.com/2017/01/19/imdb-movie-analysis/rplot01-2/" alt="rplot01" data-medium-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot011.png?w=456&amp;ssl=1?w=300" data-large-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot011.png?w=456&amp;ssl=1?w=739" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot011.png?w=456&ssl=1"></p>
<h2></h2>
<h2>Change in Gross Earnings Over Time</h2>
<p>The movie business pulls in big dollars but inflation throughout the 20th century has surely had an impact on both ticket price and, by association, gross earnings at the box office. The line graph below shows how the maximum gross earnings has changed between 1920-2016. Since the 1960’s there has been quite the upward trend in the maximum gross earnings a successful movie can make. However, there is still a lot of inherent variability in these data. The mean gross earnings doesn’t appear to change much while the same can be said for the minimum gross earnings. Why do more recent successful movies pull in higher gross earnings? Inflation of ticket prices over time perhaps?</p>
<p> </p>
<p><img sizes="(max-width: 739px) 100vw, 739px" data-image-description="" data-orig-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot022.png?w=456&amp;ssl=1" data-orig-size="788,414" data-image-title="rplot02" data-comments-opened="1" class="wp-image-424" data-recalc-dims="1" data-attachment-id="424" data-permalink="https://sw23993.wordpress.com/2017/01/19/imdb-movie-analysis/rplot02-3/" alt="rplot02" data-medium-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot022.png?w=456&amp;ssl=1?w=300" data-large-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot022.png?w=456&amp;ssl=1?w=739" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot022.png?w=456&ssl=1"></p>
<p> </p>
<h2>Are IMDB Score and Gross Earnings Related?</h2>
<p>An obvious assumption would be that higher rated movies will have done better at the box office. We can check the IMDB scores for the movies in the dataset and produce the following barplot using rating categories along the x-axis.</p>
<p> </p>
<p><img sizes="(max-width: 739px) 100vw, 739px" data-image-description="" data-orig-file="https://i0.wp.com/sw23993.files.wordpress.com/2017/01/rplot031.png?w=456&amp;ssl=1" data-orig-size="788,414" data-image-title="rplot03" data-comments-opened="1" class="wp-image-442" data-recalc-dims="1" data-attachment-id="442" data-permalink="https://sw23993.wordpress.com/2017/01/19/imdb-movie-analysis/rplot03-2/" alt="rplot03" data-medium-file="https://i0.wp.com/sw23993.files.wordpress.com/2017/01/rplot031.png?w=456&amp;ssl=1?w=300" data-large-file="https://i0.wp.com/sw23993.files.wordpress.com/2017/01/rplot031.png?w=456&amp;ssl=1?w=739" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i0.wp.com/sw23993.files.wordpress.com/2017/01/rplot031.png?w=456&ssl=1"></p>
<p> </p>
<p>As expected, movies with a higher score on IMDB tend to have done better at the box office. We know nothing about the internal variation within these categories, however, as the values given are means. Surely not all movies rated between 9-10 earned  around $150 000 000? The next barplot includes error bars which represent the standard deviations of the categorical data. Here, we see that the variation in gross earnings is very large for the 9-10 IMDB score category. Clearly not all movies rated between 9 and 10 earned as much. The standard deviations for the other categories are far less dramatic.</p>
<p> </p>
<p><img sizes="(max-width: 739px) 100vw, 739px" data-image-description="" data-orig-file="https://i2.wp.com/sw23993.files.wordpress.com/2017/01/rplot041.png?w=456&amp;ssl=1" data-orig-size="788,414" data-image-title="rplot04" data-comments-opened="1" class="wp-image-437" data-recalc-dims="1" data-attachment-id="437" data-permalink="https://sw23993.wordpress.com/2017/01/19/imdb-movie-analysis/rplot04-2/" alt="rplot04" data-medium-file="https://i2.wp.com/sw23993.files.wordpress.com/2017/01/rplot041.png?w=456&amp;ssl=1?w=300" data-large-file="https://i2.wp.com/sw23993.files.wordpress.com/2017/01/rplot041.png?w=456&amp;ssl=1?w=739" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i2.wp.com/sw23993.files.wordpress.com/2017/01/rplot041.png?w=456&ssl=1"></p>
<p> </p>
<h2>How Much of an Impact Does Ticket Price Inflation Have?</h2>
<p>I scraped movie gross earnings data from Box Office Mojo which has been adjusted for ticket price inflation (using $8.61, the 2016 average ticket price) and used it to create the following barplot. Things look a lot different after this adjustment. James Cameron remains with “Titanic” as does George Lucas with “Star Wars: Episode IV – A New Hope”. However, all of the others from earlier are absent in this new top 10 subset. “Gone with the Wind” directed by Victor Fleming tops the list of the highest gross earnings when the data are adjusted.</p>
<p> </p>
<p><img sizes="(max-width: 739px) 100vw, 739px" data-image-description="" data-orig-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot06.png?w=456&amp;ssl=1" data-orig-size="788,414" data-image-title="rplot06" data-comments-opened="1" class="wp-image-460" data-recalc-dims="1" data-attachment-id="460" data-permalink="https://sw23993.wordpress.com/2017/01/19/imdb-movie-analysis/rplot06/" alt="rplot06" data-medium-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot06.png?w=456&amp;ssl=1?w=300" data-large-file="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot06.png?w=456&amp;ssl=1?w=739" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i1.wp.com/sw23993.files.wordpress.com/2017/01/rplot06.png?w=456&ssl=1"></p>
<h2>Conclusion</h2>
<p>So there you have it! Even though modern day movies are endowed with ever more spectacular special effects and stunts, classics from the 1940’s to the 1990’s look to have been more successful in terms of gross earnings. Movies such as “Bambi” and “Pinocchio” have had multiple releases, one must remember, which have contributed to the overall gross earnings value. Had I been born a few decades earlier, I would have been the purchaser of those tickets that contributed to the earnings of these classics. It is interesting that “Jaws” is in there too as I mention this movie in another post of mine which analyses global shark attack data. Check it out <a target="_blank" rel="nofollow" href="https://sw23993.wordpress.com/2017/01/17/an-analysis-of-global-shark-attacks-between-1543-2016/">here</a>.</p>
<p> </p>
<p> </p>
<p> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sw23993.wordpress.com/370/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/sw23993.wordpress.com/370/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://sw23993.wordpress.com/2017/01/19/imdb-movie-analysis/"> Environmental Science and Data Analytics</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/_21zKBzJaCU"></a></div>