This vignette is to recreate an analysis on Pixar ratings that can be found here.
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(pixarfilms) library(dplyr) library(tidyr) library(forcats) library(ggplot2) library(irr)
Before we can visualize our data, let's wrangle our data to help us visualize it later on.
df <- public_response %>% select(-cinema_score) %>% mutate(film = fct_inorder(film)) %>% pivot_longer(cols = c("rotten_tomatoes", "metacritic", "critics_choice"), names_to = "ratings", values_to = "value") %>% mutate(ratings = case_when( ratings == "metacritic" ~ "Metacritic", ratings == "rotten_tomatoes" ~ "Rotten Tomatoes", ratings == "critics_choice" ~ "Critics Choice" )) %>% drop_na()
Their first plot was comparing the Pixar films' ratings over time.
df %>% ggplot(aes(x = film, y = value, col = ratings)) + geom_point() + geom_line(aes(group = ratings)) + scale_color_brewer(palette = "Dark2") + labs(x = "Pixar film", y = "Rating value") + guides(col = guide_legend(title = "Ratings")) + theme_minimal() + theme(axis.text.x = element_text(angle = 90, vjust = 0.5), legend.position = "bottom")
Verdict: people and critics generally agree that Cars 2 was not as good as the other Pixar films.
Next, let's group the rating categories to see if there is a consistency across.
df %>% ggplot(aes(x = ratings, y = value, col = ratings)) + geom_boxplot(width = 1.75 / length(unique(df$ratings))) + ggbeeswarm::geom_beeswarm() + ggrepel::geom_text_repel(data = . %>% filter(film == "Cars 2" ) %>% filter(ratings == "Rotten Tomatoes"), aes(label = film), point.padding = 0.4) + scale_color_brewer(palette = "Dark2") + guides(col = guide_legend(title = "Ratings")) + labs(x = "Rating group", y = "Rating value") + ylim(c(30, 100)) + theme_minimal() + theme(legend.position = "bottom")
Verdict: people at Rotten Tomatoes generally like Pixar films more than Metacritic and Critics Choice. The exception to this is Cars 2, which rated the lowest out of all critic groups.
Are the groups statistically consistent? Let's perform an interclass correlation among the different critic groups.
public_response %>% select(-c(cinema_score, film)) %>% drop_na() %>% icc(model = "twoway", type = "consistency")
Verdict: with a null hypothesis that all critic groups are not consistent, for the 21 Pixar films we have data for all critic groups, all groups are consistent in rating Pixar films (p < 0.001).
sessionInfo()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.