Link to this dataset’s documentation:
https://www.kaggle.com/datasets/thedevastator/books-sales-and-ratings
colnames(book_sales)
## [1] "index" "Publishing Year" "Book Name"
## [4] "Author" "language_code" "Author_Rating"
## [7] "Book_average_rating" "Book_ratings_count" "genre"
## [10] "gross sales" "publisher revenue" "sale price"
## [13] "sales rank" "Publisher" "units sold"
Although data pertaining to book sales seems as though it should largely be self-explanatory, there are a few instances in this data set that required reading the documentation to fully understand:
“sales rank”
“language_code”
“gross sales” vs. “publisher revenue”
Initially, I found “sales rank” to be very confusing, and although I am unsure if I have a full understanding of it, the documentation greatly assisted in helping me understand what it was showcasing. My initial assumption was that this column was showing what rank the book reached in sales when it first hit the market. I was quickly confused once I realized that there are books in this dataset published in BCE that have ratings. The documentation cleared up my confusion by stating that this column is “indicating a book’s rank based on its sales performance in comparison to other books within its category (genre)”, which helped me understand that this ranking does not have anything to do with how the books do at publication, but how they are currently doing against books of their same genres.
“Language_code” was a bit confusing due to appearance of multiple forms of English.
language_codes<- unique(book_sales$language_code)
language_codes
## [1] "en-US" "eng" NA "spa" "en-GB" "fre" "en-CA" "nl" "ara"
After reading the documentation, I believe that this was a conscious choice in order to allow for more in depth analysis on language and region. Although most of the books have some sort of English language code, including regions allow for this data to be broken down in more ways.
Although the “gross sales” and “publisher revenue” are seemingly self-explanatory, I found it important to thoroughly read the documentation to understand exactly what these metrics are and the differences between them. According to the documentation, “gross sales” is what each book itself earned in total, whereas “publisher revenue” is only what the publisher earned. I found this to be an important clarification.
As for data that my documentation does not clearly explain, the “Author_Rating” column has proved to be difficult for me to understand without making assumptions. This column features categorical values and can be one of four values: novice, intermediate, excellent, or famous. The documentation claims that this column is “This rating is based on their previous works and serves as an indicator of their reputation or acclaim among readers.” This does not make it exactly clear as to where or how this data was attained.
Let’s take a look at Stephen King, who wrote multiple books featured on this dataset.
stephen_king <- book_sales |>
filter(Author == "Stephen King")
ratings <- table(stephen_king$Author_Rating, stephen_king$`Publishing Year`)
ratings_df <- as.data.frame.matrix(ratings)
print(ratings_df)
## 1979 1980 1981 1982 1985 1987 1989 1990 1991 1992 1995 1996 1998
## Excellent 0 0 0 0 0 0 0 0 0 0 0 0 0
## Famous 0 0 0 0 0 1 0 0 0 1 0 0 0
## Intermediate 1 2 1 1 1 2 1 1 1 0 1 1 1
## 1999 2002 2004 2006 2008 2010 2013 2014 2015
## Excellent 0 0 1 0 0 1 0 0 1
## Famous 0 0 0 0 0 0 0 0 0
## Intermediate 3 1 0 1 1 0 2 2 0
Stephen King showcases several books since 1979, and with each book, came an “Author_Rating”. I have assumed that Author_Rating is a general consensus of where the author is at in their career when releasing this book, but this assumption does not make complete sense, as his Author_Rating early on in his career is “Intermediate” rather than “Novice”. Furthermore, if this were the case, it would be likely for an author to begin as a novice and work there way up to famous, however, Stephen King showcases a bit of inconsistency. In 1987 he was considered both “Intermediate” and “Famous” and then from 2002 through 2006, he goes from intermediate, to excellent, back to intermediate.
I have tried to view this column from a few separate angles and have read the documentation multiple times, yet I continue to find myself not being able to fully understand the “Author_Rating”.
stephen_king <- book_sales |>
filter(Author == "Stephen King")
# mapping categorical values to numbers in order to visualize
rating_mapping <- c("Novice" = 1, "Intermediate" = 2, "Excellent" = 3, "Famous" = 4)
stephen_king$Numeric_Rating <- as.numeric(factor(stephen_king$Author_Rating, levels = names(rating_mapping)))
rating_year_summary <- stephen_king |>
group_by(`Publishing Year`) |>
summarize(mean_numeric_rating = mean(Numeric_Rating))
ggplot(rating_year_summary, aes(x = `Publishing Year`, y = mean_numeric_rating)) +
geom_line() +
labs(title = "Mean Author Rating Over Time for Stephen King",
x = "Publishing Year",
y = "Mean Numeric Author Rating") +
theme_minimal()
When the categorical rating values are converted to integers, you can easily see the inconsistencies in the “Author Rating”. The documentation does not answer how an author can go from being considered “famous” in the early nineties, and then drop to being an “intermediate” author afterwards. One would assume that an author with as many publications as Stephen King would begin as a novice and work his way up to being famous, however this does not seem to be the case.
I do believe that this introduces some risks if use, therefore I may avoid using it all together. Other metrics included in the dataset set as book ratings and the sales data when sorted by each author could be used as an alternative method for identifying trends between author popularity when the “Author Rating” column appears to be unreliable, unless the documentation is updated to provide more information.