<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Avani Gupta on Medium]]></title>
        <description><![CDATA[Stories by Avani Gupta on Medium]]></description>
        <link>https://medium.com/@avatree?source=rss-8419484784b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*HLp6WALQktDhTRKk.jpeg</url>
            <title>Stories by Avani Gupta on Medium</title>
            <link>https://medium.com/@avatree?source=rss-8419484784b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 05:51:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@avatree/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fantasy Basketball Lineup Generator]]></title>
            <link>https://medium.com/analytics-vidhya/fantasy-basketball-lineup-generator-d4fbd65680f1?source=rss-8419484784b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4fbd65680f1</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[fantasy-basketball]]></category>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Avani Gupta]]></dc:creator>
            <pubDate>Mon, 27 Apr 2020 19:27:54 GMT</pubDate>
            <atom:updated>2020-05-01T17:42:00.934Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The goal of this analysis is to create a model to predict the best fantasy lineup for a certain game using only the statistics of the games previously played in the season as inputs. Whilst the logic for the model is created by analyzing various season progressions, the model itself can only use player histories from the start of the season in which the game to be predicted is in.</em></p><p><em>Full code </em><a href="https://github.com/avanigupta1/basketball/blob/master/EDA.ipynb"><em>here</em></a><em>.</em></p><h3>Project Parameters</h3><p>Each lineup consists of 8 players: 2 guards, 2 forwards/centers, 2 utility players (guards, forwards, or centers), and 2 bench players (players with no start position but have played more than 0 minutes in the season to date).</p><p>The aim is to select a lineup that optimizes fantasy points. For each run of the model, there is a random scoring matrix instantiated that appends a certain number of points to a selected number of player statistics. There are 18 potential statistics than can be incorporated into the scoring matrix, such as rebounds (‘reb’), points (‘pts’), blocks (‘blk’), and so on.</p><p>Given that the system starts with no historical data and continues to learn from game-to-game statistics, it seemingly does not make sense to create a complex model, whether that be parametric or non-parametric. If any form of even a regression was used, the model would most likely output uninformed results for the first half of the season, given the minimal data input. Additionally, it would involve game-by-game tuning of the parameters, which goes against the intent of drop-in usability — the model should be able to perform at any point in the season with any team.</p><p>There are two final models created: one, team-specific (get the best lineup for a single team); two, league specific (get the best lineup across all players in the league).</p><ul><li><a href="#aa87">Team-Specific Model Creation &amp; Evaluation</a></li><li><a href="#6171">League-Specific Model Creation &amp; Evaluation</a></li></ul><h3>Exploratory Analysis</h3><p>To initially explore the data, I will be reviewing the 2017 NBA Season.</p><h4>Position-Specific Stat Contribution</h4><p>I’m curious to see whether there are stark differences between the best performing statistic per position. As seen below, the balance of points across the stats for each player seems to be in line, with the exception of rebounds for centers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uo3qKFY_0dvvsqWtdfoLgg.png" /><figcaption>Average Stat Differentiation Between Positions</figcaption></figure><h4>Seasonality Trends</h4><p>It seems necessary to look into seasonality trends across stats and overall points for all teams. My goal is to see if there are standardized spikes for all teams at the same points during the season, as that could inform some sort of weightage moving forward. As seen in the two plots below, teams seem generally even in the minor-stats across the board, with spikes in the overall points coming at different points in the season.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8CVQ2UdjENk_uH4wcL7TIg.png" /><figcaption>Seasonal Progession Fluctuations Per Stat Per Team</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LSUl6F3NmJr2D4NzaWzE0Q.png" /><figcaption>Seasonal Progession Fluctuations For Overall Points Per Team</figcaption></figure><h4>Point Aggregation</h4><p>My initial assumption was that the simplest way to predict each player’s performance per stat would be to calculate their average per min in that statistic to that point and multiply it by their average minutes played. While this would empirically make sense, there are countless decisions and factors that influence a player’s performance, in addition to their performance either getting better or worse as the season progresses.</p><p>With this in mind, I performed an analysis to compare a range of rolling window averages to the player’s performance in each subsequent game. The method takes in a rolling window from 1–20, calculates the player’s average using said window (computes the average of the last x games; if less than x games have been played, computes the average of all previous), and calculates the mean squared error for all players using that window compared to their true scores. Below, I have tested this out on just those in the guard position.</p><p>As seen above, there seems to be a steep drop in many stats between window sizes of 2 and 5. Though there are over 70 games played in a season, I wanted to keep the window values low as to compare to a full running average in scores that will be conducted further on into this analysis.</p><p>Given that the error does decrease with a specific window, I wanted to find the minimum squared error per stat per position and use that specific window when creating the model. As this is computationally intensive, I found the optimized windows for minutes played and total points only. As seen in a post-run summary below, for all positions between the two stats, the ranges per team fell around window=5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*XiSEoXOWSr1Y_TOb613Nug.png" /><figcaption>MSE of Increasing Rolling Window Average Prediction of Stat Per Min</figcaption></figure><h3>Model Creation</h3><p>For the modeling portion, I will be creating two systems: one that uses running overall averages, and one that uses rolling window averages.</p><p>Each model consists of the following methods:</p><h4>1. Data Filtering</h4><ul><li>As the season is already instantiated in the data import section, this portion further cleans the data to filter by team (for the team-specific model)</li><li>Bench designations are input for those players who have played more than 0 minutes but have no start position</li></ul><h4>2. History Scoring</h4><p>If this is not the first game of the season:</p><ul><li>The dataset is filtered to include all data from before the designated game to predict for</li><li>Each statistic listed in the scoring matrix is converted to stat per min within the historical data</li><li>Average (total or rolling) for each of those statistics, in addition to minutes played, are then calculated and returned per player per position</li><li>Each statistic listed in the scoring matrix is then multiplied by the output average minutes as the predicted points per stat in the upcoming game</li><li>Each predicted statistic is then multiplied by the points designated to said statistic within the scoring matrix</li><li>Per each player and position, total fantasy points as designated by the scoring matrix are returned</li></ul><p>If this is the first game of the season:</p><ul><li>Total fantasy points per player = 0</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0272352ac97f2c983695383fe0ee03eb/href">https://medium.com/media/0272352ac97f2c983695383fe0ee03eb/href</a></iframe><h4>3. Lineup Creation</h4><ul><li>Using the total points from the History Scoring section, the two highest point-getters per position category are added to the lineup</li><li>Running list of player names created to not include the same player in a separate position</li></ul><h4>4. Score Prediction</h4><ul><li>Using only the names and positions in the lineup, the data is filtered on the real points scored in the game to predict for</li><li>Each player’s stat is multiplied by its fantasy point designation, and all points are summed for total fantasy points</li></ul><h4>5. Real Optimal Lineup</h4><ul><li>Used for model testing</li><li>Find the true optimal lineup from the game to predict for; return fantasy points</li></ul><h3>Team-Specific Model Comparison &amp; Evaluation</h3><p>To compare the two models, predicted score outputs are plotted below for the first 70 games of the 2017 season with 9 different teams. Additionally, the real optimized lineup output score is included to compare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnOfLmPg5y08NjJqhXu24w.png" /><figcaption>Average, Rolling Average, and True Optimized Lineup Fantasy Points for Selected Teams for Games 1–70 of the 2018 Season</figcaption></figure><p>As seen above in the 9 selected teams for the 2017 season, the rolling model does generally outperform the average model. While in some instances the average model does to slightly better than the rolling (around game 40 in Houston), the rolling model overall does much better, especially with certain teams (e.g. Cleveland). Additionally, the rolling model seems quite in line with the real best-optimized lineup, often taking the same shape, and periodically resulting in equal point totals.</p><p>We can review the same results on the 2018 season with a different scoring matrix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZK_ud6sKWv_69uCrH9Zug.png" /><figcaption>Average, Rolling Average, and True Optimized Lineup Fantasy Points for Selected Teams for Games 1–70 of the 2018 Season</figcaption></figure><p>Given the results of both models as compared to the true optimized lineup scores, proceeding with the rolling average model seems like the best course.</p><h3>League-Specific Model Comparison &amp; Evaluation</h3><p>For full-league lineup optimization, the same logic stands as was listed in the Model Creation section. However, the data is no longer filtered at a team level, and a rank column is input for each team to show where they are in the season. The rank column stands as an equalizer across the league to incorporate the same amount of season-progression per player.</p><pre>games_details[&#39;rank&#39;]=games_details.groupby(&quot;TEAM_ABBREVIATION&quot;)[&quot;GAME_ID&quot;].rank(&quot;dense&quot;)</pre><p>Based on the performance of the rolling average model over the running average model on a team level, only the rolling average model is used when viewing the league overall. Full code for this method can be found <a href="https://github.com/avanigupta1/basketball/blob/master/EDA.ipynb">here</a> in the ‘League Specific Model’ section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wAGViz9Z3Y6_kYF2PRV_og.png" /><figcaption>Rolling Average and True Optimized Lineup Fantasy Points Across League for Games 1–70 of the 2017 Season</figcaption></figure><h3>Further Work &amp; Limitations</h3><p>There is no doubt this analysis would be better served with a greater historical understanding of the game, the coaching and real-time lineup decisions made, and each individual position’s strengths and weaknesses. Given this, there are certainly additional optimizations that could improve the model.</p><p>In continuing this analysis, it would be prudent to test all seasons, teams, and positions, and see if there is any change in window range predictions. Additionally, performing much deeper research on other algorithms and less-complex models used in other fantasy sports could be beneficial in allowing a more exact prediction without having to retrain and test a model after each game.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4fbd65680f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/fantasy-basketball-lineup-generator-d4fbd65680f1">Fantasy Basketball Lineup Generator</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Box Office Predictions Using R]]></title>
            <link>https://medium.com/swlh/box-office-predictions-using-r-33de8665fcbf?source=rss-8419484784b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/33de8665fcbf</guid>
            <category><![CDATA[r]]></category>
            <category><![CDATA[statistical-analysis]]></category>
            <category><![CDATA[box-office]]></category>
            <dc:creator><![CDATA[Avani Gupta]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 20:03:31 GMT</pubDate>
            <atom:updated>2020-04-30T21:46:23.335Z</atom:updated>
            <content:encoded><![CDATA[<h3>Box Office Predictive Analysis Using R</h3><p><em>The goal of this analysis is to analyze any trends in the top 100 box office opening weekends in the current decade, and expand those trends and learnings to predict future opening weekends.</em></p><p><a href="https://github.com/avanigupta1/Box-Office-Predictions/blob/master/Full%20Markdown%20Code">Full code can be found here</a>, with final report below:</p><h3>Section 1: Training Data Analysis and Modeling</h3><h3>1. Research Question</h3><p>Can a combination of distribution, release, and marketing factors predict the opening weekend box office revenue for movies in the United States?</p><p>To delve into this question, an exploratory analysis was done, as opposed to a hypothesis-driven one. Additionally, the movie’s budget was not taken into consideration, as the aim of this study was to focus on what, and to what extent, aspects surrounding the perception of a movie result in the audience’s willingness to see it during its opening weekend.</p><h3>2. Data Description &amp; Dictionary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*SOVsDEWpwjuoOw3wrIpnIw.png" /></figure><p>To proceed with the analysis, variables were initially chosen based on theoretical assumptions and then tested for usability later on. The response variable is ‘Opening Mil’, which is the total US opening weekend revenue of a film, in millions. Theatre count, month and year of release, runtime, and distribution studio were then added in. Additionally, the primary listed genre was taken into account, along with a self-reported variable called ‘type’. The aim of including type was to take into account a film’s place in a wider pop cultural landscape, such as whether it was based on pre-existing intellectual property or if it was an extension of a franchise. Lastly, scores from ‘The Bankability Index’ were included to account for star power and how important certain stars or directors are in corralling an audience to the theatre.</p><p>The data used in this analysis has been aggregated from websites such as BoxOfficeMojo, IMDb, and The Numbers Bankability Index.</p><h3>3. Initial Limitations</h3><p>Though the analysis attempts to incorporate a variety of impactful factors, there are strong limitations present, such as:</p><ul><li>Small sample size and arbitrary cut off: the data only takes into account the top 100 movies of the past 8 years</li><li>Inability to gauge the change in audience interaction with film in the last decade in regards to YouTube and social media</li><li>Inability to incorporate social conversation, such as a sudden social media push or scandal surrounding the film</li><li>Potential errors in self-reported variables such as ‘Type’</li><li>Incomplete representation of all cast and crew in the sum that composes the ‘Bankability’ variable</li></ul><h3>4. Methods of Analysis</h3><h4>Model Construction</h4><p>As the response variable of note is continuous, a linear model was chosen to analyze the data.</p><h4>Regression Assumptions</h4><ul><li>Sample Size: While it would be more prudent to have a larger set in this sort of analysis, the analysis set consists of 800 movies.</li><li>Normal Distribution: Initially, the response data was extremely right skewed. However, after logging the variable, the distribution proved to be normal.</li><li>Multicollinearity Concerns: The highest correlation between any continuous variable is ~0.7, which is on the higher end, but does not necessarily negate either variable’s use in the analysis.</li></ul><h4>Exploratory Data Analysis</h4><p>Regarding the continuous variables, there seemed to be a clear quadratic relationship between the response variable, Opening Mil(Log), and Theatre Thou, as can be seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*WQCx-HZpbKaYSktD.png" /></figure><p>Within the categorical variables, Genre1, Type, Month, and Studio were all extremely varied across sub-categories. Additionally, many interactions seemed present, such as Genre1 and Type, however they were either hindered by under-representation of level-level relationships in the data, or were merely somewhat correlated as opposed to interactive.</p><h4>Linear Modeling</h4><p>After testing out the usability of variables and potential interactions using interaction analysis and ANOVA tests, the final linear model is as follows:</p><p>Previously included variables, such as ‘GenreNum’, were present in the analysis. The variable served to address the fact that many films are an amalgam of genres, and was included over a secondary genre variable, as there were too many missing values in the dataset. ‘GenreNum’ was eventually removed due to seeming insignificance resulting from a nested F-test.</p><p>The final model summary is as follows:</p><pre>## <br>## Call:<br>## lm(formula = logOpeningMil ~ TheatreThou + TheatreThou.2 + Runtime + <br>##     Bankability + as.factor(Year) + Studio + Genre1 + Holiday + <br>##     Type + Month, data = fullSet)<br>## <br>## Residuals:<br>##      Min       1Q   Median       3Q      Max <br>## -1.04547 -0.27554 -0.02817  0.25847  1.55165 <br>## <br>## Coefficients:<br>##                           Estimate Std. Error t value Pr(&gt;|t|)    <br>## (Intercept)              3.235e+00  2.973e-01  10.879  &lt; 2e-16 ***<br>## TheatreThou             -1.161e+00  1.641e-01  -7.074 3.48e-12 ***<br>## TheatreThou.2            3.114e-01  2.855e-02  10.908  &lt; 2e-16 ***<br>## Runtime                  4.841e-03  1.068e-03   4.533 6.78e-06 ***<br>## Bankability              6.042e-04  7.877e-05   7.671 5.39e-14 ***<br>## as.factor(Year)2011     -4.502e-02  5.838e-02  -0.771 0.440866    <br>## as.factor(Year)2012     -2.696e-02  5.897e-02  -0.457 0.647709    <br>## as.factor(Year)2013     -5.912e-02  6.008e-02  -0.984 0.325403    <br>## as.factor(Year)2014     -6.032e-02  5.944e-02  -1.015 0.310585    <br>## as.factor(Year)2015     -1.592e-01  5.919e-02  -2.689 0.007325 ** <br>## as.factor(Year)2016     -1.999e-01  5.969e-02  -3.349 0.000853 ***<br>## as.factor(Year)2017     -3.524e-01  6.162e-02  -5.720 1.55e-08 ***<br>## StudioCBS               -4.473e-01  1.782e-01  -2.510 0.012273 *  <br>## StudioDisney             9.512e-02  1.618e-01   0.588 0.556705    <br>## StudioFocus             -3.692e-01  1.284e-01  -2.875 0.004150 ** <br>## StudioFox               -2.686e-01  6.571e-02  -4.088 4.82e-05 ***<br>## StudioLG/S              -2.356e-01  9.773e-02  -2.411 0.016158 *  <br>## StudioLGF               -1.407e-01  8.278e-02  -1.700 0.089546 .  <br>## StudioORF               -5.320e-01  1.249e-01  -4.258 2.33e-05 ***<br>## StudioOther             -4.048e-01  1.004e-01  -4.031 6.13e-05 ***<br>## StudioP/DW              -3.738e-01  1.420e-01  -2.631 0.008678 ** <br>## StudioPar.              -2.483e-01  7.196e-02  -3.450 0.000591 ***<br>## StudioRela.             -4.627e-01  1.115e-01  -4.151 3.69e-05 ***<br>## StudioSGem               7.368e-02  1.000e-01   0.737 0.461614    <br>## StudioSony              -2.323e-01  7.045e-02  -3.298 0.001020 ** <br>## StudioSTX               -4.236e-01  1.443e-01  -2.935 0.003440 ** <br>## StudioTriS              -7.690e-02  1.169e-01  -0.658 0.510741    <br>## StudioUni.              -1.642e-02  6.640e-02  -0.247 0.804740    <br>## StudioW/Dim.            -5.197e-01  1.794e-01  -2.897 0.003875 ** <br>## StudioWB                -2.572e-01  6.704e-02  -3.837 0.000135 ***<br>## StudioWB (NL)           -1.790e-01  8.719e-02  -2.053 0.040409 *  <br>## StudioWein.             -2.599e-01  1.584e-01  -1.641 0.101272    <br>## Genre1Action            -4.856e-02  5.360e-02  -0.906 0.365212    <br>## Genre1Adventure         -5.721e-02  7.332e-02  -0.780 0.435459    <br>## Genre1Animation/Family  -1.390e-02  7.855e-02  -0.177 0.859590    <br>## Genre1Biography         -4.272e-02  8.722e-02  -0.490 0.624383    <br>## Genre1Comedy            -7.729e-02  5.777e-02  -1.338 0.181312    <br>## Genre1Crime             -4.222e-02  8.832e-02  -0.478 0.632756    <br>## Genre1Documentary        1.021e-01  1.693e-01   0.603 0.546912    <br>## Genre1Fantasy            4.860e-03  2.455e-01   0.020 0.984214    <br>## Genre1Horror             3.186e-01  7.903e-02   4.032 6.11e-05 ***<br>## Genre1Mystery            3.266e-01  2.140e-01   1.526 0.127416    <br>## HolidayYes              -8.147e-02  4.132e-02  -1.972 0.049034 *  <br>## TypeFranchise            2.081e-01  4.836e-02   4.303 1.91e-05 ***<br>## TypePrevious History/IP  3.483e-02  4.352e-02   0.800 0.423693    <br>## TypeRemake              -2.949e-04  7.013e-02  -0.004 0.996646    <br>## TypeRerelease            2.492e-01  1.773e-01   1.406 0.160192    <br>## TypeSequel               8.239e-02  5.558e-02   1.482 0.138648    <br>## MonthApril              -1.690e-01  7.651e-02  -2.209 0.027468 *  <br>## MonthAugust             -2.359e-01  7.363e-02  -3.203 0.001418 ** <br>## MonthDecember           -3.008e-01  7.799e-02  -3.856 0.000125 ***<br>## MonthFebruary            6.176e-02  7.296e-02   0.846 0.397558    <br>## MonthJuly               -8.924e-02  7.252e-02  -1.231 0.218847    <br>## MonthJune                9.921e-03  7.545e-02   0.131 0.895424    <br>## MonthMarch              -9.077e-03  7.500e-02  -0.121 0.903697    <br>## MonthMay                -1.209e-01  7.876e-02  -1.535 0.125247    <br>## MonthNovember            2.875e-02  7.580e-02   0.379 0.704640    <br>## MonthOctober            -1.645e-01  7.359e-02  -2.236 0.025678 *  <br>## MonthSeptember          -2.166e-01  7.528e-02  -2.878 0.004119 ** <br>## ---<br>## Signif. codes:  0 &#39;***&#39; 0.001 &#39;**&#39; 0.01 &#39;*&#39; 0.05 &#39;.&#39; 0.1 &#39; &#39; 1<br>## <br>## Residual standard error: 0.405 on 741 degrees of freedom<br>## Multiple R-squared:  0.7241,	Adjusted R-squared:  0.7025 <br>## F-statistic: 33.53 on 58 and 741 DF,  p-value: &lt; 2.2e-16</pre><h4>Residuals &amp; Influence Diagnostics</h4><p>When reviewing influence diagnostics such as Leverage and Cook’s Distance, the 7 outlying points were all within categories that were relatively under-represented in the data (such as Rereleases and Fantasy films). These points were not removed.</p><p>The residuals of the final linear model were fairly well vertically-distributed, as can be seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*-nqe5-XEjuVTGnLL.png" /></figure><h3>5. Interpretations &amp; Takeaways</h3><p>Using the linear model created above, the observed values in the 800-movie dataset were plotted against the predicted values to get a sense of fit, as seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*EQ1HfTFzJIqIB3HB.png" /></figure><p>While the model resulted in 60 estimated coefficients, due to the categorical nature of much of the data, the following have been extracted to best summarize the results of the regression.</p><p>The estimated opening weekend intercept value is $25.4 million, with a 95% CI of $14.17 mil to $45.53 mil</p><p>With all else being held constant:</p><ul><li>Moving from a release on a non-holiday weekend to a holiday weekend estimates a 7.8% decrease (CI: -15% to -0.03%) This result on its surface looks incorrect, as one would assume a holiday film would appeal to a wider audience. However, the estimates are aggregated as Friday-Sunday, while holiday movies get a bulk of their audience during the non-weekend days associated with said holiday.</li><li>An increase of 15 minutes in a film’s runtime is estimated to constitute a 7.5% increase in revenue (CI: 4.2% to 10.9%) This also seems problematic, as this may make sense for films only in the lower end of the set</li><li>An increase in Bankability score by 100 points is estimated to lead to a 6.2% increase in revenue (CI: 4.6% to 7.9%)</li><li>Month and Studio both prove to be problematic, as the estimates either have large p-values or unusually large confidence intervals.</li><li>February, commonly known as ‘Dumpuary’ in Hollywood as many ‘bad’ movies are released, is estimated as the highest grossing month with a 6.4% increase from the second-ranked month. This is accompanied by a large CI from -7.8% to 22.8%.</li><li>Disney has the highest estimate with 9.98% increase from the base-level, with a vast CI from -19.8% to 51.%.</li><li>Revenues seem to progressively decrease as the years increase, with 2017 showing an estimated decrease of 29.7% from 2010 CI: -37.7% to -20.66%)</li><li>Interpretative graphs of changes in Genre, Type, and Theatre Count below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*3eUsvZ53CRXR1z4-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*-l1SyFHKC5wnVViX.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*pS61_OitpAIRdW9_.png" /></figure><h3>Section 2: Predictive Modeling for 2018</h3><p>Using the linear model created in the previous section, would it be possible to predict the highest-grossing films of 2018?</p><h4>Data Collection</h4><p>Same data methods used to obtain a test set for the year 2018, from Jan 1 to Nov 29.</p><h4>Limitations</h4><p>As 2018 was not present in the Year variable in the training set, 2017 was used in its place within the test set.</p><h4>Results</h4><p>Differences (observed minus predicted) were used to analyze the model. The absolute value mean of the differences was 11.34 mil, with a standard deviation of 18.52 mil. Results below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*He_-b0_NsOP7XQ0G.png" /></figure><h4>Takeaways</h4><p>Overperforming films such as Black Panther and Crazy Rich Asians took on social importance during the lead-up to their releases and became box office juggernauts. That type of groundswell has not been accounted for and would be extremely difficult to gauge in a long-range forecasting effort.</p><h4>Future Analysis</h4><p>As this is a very surface-level analysis with an incredibly small sample size, it would be prudent to go deeper into prediction regression and modes of analysis for further inquiry.</p><h3>Section 3: The Rotten Tomatoes Effect</h3><p>The film-score aggregator Rotten Tomatoes rose to prominence in 2016, and since then has been accused of being the cause of box-office failures. Is there any merit to these claims? As an off-shoot experiment of the primary analysis, Rotten Tomatoes data has been added into the dataset to analyze this argument.</p><h4>Data</h4><p>Rotten Tomatoes (RT) aggregates critic and audience reviews of a movie and sums them to construct a score out of 100. Scores &gt; 60 are classified as “Fresh”, and &lt; 60 are considered “Rotten”.</p><p>For this experiment, RT scores for each movie from 2016 and 2017 were obtained from the day before or of their release.</p><h4>Analysis &amp; Interpretation</h4><p>Two linear models were used to analyze this effect: using RT score as a continuous variable and using the RT classifications categorically. Both variables had significant p-values when predicting opening revenue, approximating that:</p><ul><li>A 1-point RT increase is estimated to result in a 0.39% increase in revenue (95% CI: 0.11 % to 0.66%)</li><li>Moving from Rotten to Fresh is estimated to have a 24.5% increase in revenue (95% CI: 6.99% to 45%)</li><li>Increase in RT score does not seem particularly impactful, however, moving classification categories could have a drastic impact on box office. Figure below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*itYewpNxVslXpJ0Z.png" /></figure><h4>Limitations</h4><p>This particular experiment is based on a small dataset with minimal diagnostics, so much more analysis would need to be done to confidently discuss the merits of this claim.</p><h4>References</h4><ul><li>Box Office Mojo, accessed 2018, <a href="https://www.boxofficemojo.com/">https://www.boxofficemojo.com/</a></li><li>The Numbers Bankability Index, accessed 2018, <a href="https://www.the-numbers.com/bankability/">https://www.the-numbers.com/bankability/</a> TimeAndDate, accessed 2018, <a href="https://www..%20timeanddatecom/">https://www.. timeanddatecom/</a></li><li>IMDb, accessed 2018, <a href="https://www.imdb.com/">https://www.imdb.com/</a></li><li>Barnes, Brooke. “Attacked by Rotten Tomatoes.” The New York Times 7 Sept. 2017. <a href="https://www.nytimes.com/2017/09/07/business/media/rotten-tomatoes-box-office.html">https://www.nytimes.com/2017/09/07/business/media/rotten-tomatoes-box-office.html</a></li><li>McClintock, P. (2017, Aug 2). Studios Fight Back Against Withering Rotten Tomatoes Scores [Blog post]. Retrieved https://www.hollywoodreporter.com/news/studios-fight-back-withering- rotten-tomatoes-scores-1025575</li><li>Fennessey, S. (2017, Aug 16). Can Rotten Tomatoes Crush a Movie at the Box Office? [Blog post]. Retrieved from https://www.theringer.com/movies/2017/8/16/16156954/rotten-tomatoes-box- office-failure-baywatch-dark-tower-get-out</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33de8665fcbf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/box-office-predictions-using-r-33de8665fcbf">Box Office Predictions Using R</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>