import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
movies = pd.read_csv("https://raw.githubusercontent.com/33phoebe/datasets/master/fandango_score_comparison.csv")
movies.head()
the dataset is cleaned by FiveThirtyEight and contains every film that has a Rotten Tomatoes rating, a RT User rating, a Metacritic score, a Metacritic User score, and IMDb score, and at least 30 fan reviews on Fandango. The data from Fandango was pulled on Aug. 24, 2015.
movies["Metacritic_norm_round"].hist()
movies["Fandango_Stars"].hist()
- metacritic is more normally distributed, with the highest freq occurs in the middle, around 3 points. Also a fair amount of movies have lower values and some at higher
- fandango's stars are skewed, with highest freq occurs around 4.5, which is significantly higher than the metacritic record. Also, there is no movie having a score lower than 3, and quite a few at 5.
fan = movies["Fandango_Stars"]
meta = movies["Metacritic_norm_round"]
print("Fandango Mean:",fan.mean(),"\nMetacritic Mean:",meta.mean())
print("Fandango Median:", fan.median(), "\nMetacritic Median:", meta.median())
print("Fandango Stdev:", fan.std(), "\nMetacritic Stdev:", meta.std())
Fandango doesn't explain in much details of their methodology, only vaguely mentions they incorporate a few sources; metacritics explains it uses a 100-point weighted average based on the critic's input and how their reviews are categorized into three groups representing their quality.
- Metacritic's mean is fairly close to median, slightly lower, as the graph above shows, metacritics have more higher rated movies than the ones that have really bad reviews, which make sense. And the fact that these two numbers are close represent the existence of outliers are moderate. On the other hand, the reviews of Fandango skews to the right, with the highest freq occurs at 4.5, which isn't normal given the perfect score is 5.
- Fandango's star system is based on a 5 point discrete rating system, and the mininum value is around 3, made the range of variance very small; and metacritic scores, although of significant amount, are converted from a 100-point system and have more variety, also, even not in large amount, they have movies have extreme scores and make the variance much higher.
- The mean of Fandango is much higher than Metacritic shows that its score is skewed.
fig, ax = plt.subplots()
ax.scatter(fan, meta)
ax.set_xlabel("fandango stars")
ax.set_ylabel("metacritic review")
movies["fm_diff"] = abs(fan - meta)
movies.sort_values("fm_diff", inplace = True, ascending = False)
movies.head()
from scipy.stats import pearsonr
r, p_value = pearsonr(fan, meta)
print(r, p_value)
The correlation is fairly low, while the significance is relatively high, it could mean either metacritic isn't a major source for fandango score, thus their scores are independent of each other; or fandango score has been altered from original scores severely based on metacritic score, thus the covariance compared to their individual variance is low.
from scipy.stats import linregress
slope, intercept, r, p_value, stderr_slope = linregress(meta, fan)
print(slope, intercept, r, p_value)
pred_3 = 3 * slope + intercept
pred_1 = 1 * slope + intercept
pred_5 = 5 * slope + intercept
print(pred_3, pred_1, pred_5)
- Based on the linear regression model, a movie with a 3.0 score would get it a 4.09 on Fandango, more than 1 whole point higher
x = [1, 5]
y = [pred_1, pred_5]
plt.scatter(meta, fan)
plt.xlim(1, 5)
plt.plot(x, y)
plt.show()