Chapter 9 Total Views

The following plot shows the distribution of Total Views for a Hidden Gem

  • Minimum number of Total Views is 228

  • Maximum number of Total Views is 182641

  • Median number of Total Views is 3098

95% Confidence Interval for a Hidden Gem Views is between 4583 and 7808

9.1 Box Plot

kvcs %>%
  filter(!is.na(TotalViews)) %>%
      ggplot(aes(x = TotalViews, fill = fillColor2)) +
      geom_boxplot() + 
      labs(x= ' [Total TotalViews]',y = ' [Count]', title = paste("Distribution of", ' Total TotalViews ')) +
      theme_fivethirtyeight(base_size = 15) +
  theme(legend.position = "none") 

9.2 Density Plot

kvcs %>%
  filter(!is.na(TotalViews)) %>%
      ggplot(aes(x = TotalViews)) +
      geom_density(fill = "orange", bw = 0.01) +
      labs(x= ' [TotalViews]',y = ' [Count]', title = paste("Distribution of", ' Total TotalViews ')) +
  guides(fill=guide_legend(title="Total TotalViews Distribution")) +
      theme_fivethirtyeight()

9.3 Histogram Plot

kvcs %>%
  filter(!is.na(TotalViews)) %>%
      ggplot(aes(x = TotalViews, fill = fillColor2)) +
      geom_histogram() +
      scale_x_log10() +
      scale_y_log10() + 
      labs(x= 'Log [TotalViews]',y = 'Log [Count]', title = paste("Distribution of", ' Total Views ')) +
  guides(fill=guide_legend(title="Total Views Distribution")) +
      theme_fivethirtyeight(base_size = 15)

9.4 Summary Statistics for Total Views

summary(kvcs$TotalViews)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##     228    1316    3098    6196    6452  182641       8

9.5 95% Confidence Interval for Hidden Gems Total Views

# Calculate the mean and standard error
l.model <- lm(TotalViews ~ 1, kvcs)

# Calculate the confidence interval
confint(l.model, level=0.95)
##                2.5 %   97.5 %
## (Intercept) 4583.009 7808.156