This article uses regression algorithms to estimate parameters based on the Kaggle dataset of Amazon’s Top 50 Best Selling Books, with a specific URL of https://www.kaggle.com/sootersaalu/amazon-top-50-bestselling-books-2009-2019. A mathematical model has been derived between Amazon’s annual sales volume, price, and book ratings. Based on this mathematical model, a pricing strategy can be identified to increase Amazon’s profits. Amazon can adjust book prices according to this model, which can increase the company’s annual sales volume. This price decision-making mechanism can be automatically completed by computers, thus not increasing Amazon’s labor costs and increasing its existing profits.
The data analysis tool I used is R language. Firstly, I imported the data into R Studio and conducted simple cleaning and preliminary analysis.
#Importing the 'readr' package and loading the data.
library(readr)
df <- read_csv("Downloads/bestsellers with categories.csv")
## Rows: 550 Columns: 7
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): Name, Author, Genre
## dbl (4): User Rating, Reviews, Price, Year
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#Clean the data and remove duplicate entries.
duplicated(df)
## [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [97] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [109] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [121] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [133] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [145] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [157] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [169] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [181] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [193] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [205] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [217] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [229] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [241] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [253] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [265] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [277] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [289] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [301] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [313] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [325] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [337] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [349] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [361] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [373] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [385] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [397] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [409] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [421] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [433] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [445] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [457] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [469] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [481] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [493] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [505] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [517] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [529] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [541] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#Descriptive statistical analysis, examining headers, structure, and dimensions
head(df)
## # A tibble: 6 × 7
## Name Author `User Rating` Reviews Price Year Genre
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr>
## 1 10-Day Green Smoothie Cleanse JJ Sm… 4.7 17350 8 2016 Non …
## 2 11/22/63: A Novel Steph… 4.6 2052 22 2011 Fict…
## 3 12 Rules for Life: An Antidote… Jorda… 4.7 18979 15 2018 Non …
## 4 1984 (Signet Classics) Georg… 4.7 21424 6 2017 Fict…
## 5 5,000 Awesome Facts (About Eve… Natio… 4.8 7665 12 2019 Non …
## 6 A Dance with Dragons (A Song o… Georg… 4.4 12643 11 2011 Fict…
str(df)
## spc_tbl_ [550 × 7] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
## $ Name : chr [1:550] "10-Day Green Smoothie Cleanse" "11/22/63: A Novel" "12 Rules for Life: An Antidote to Chaos" "1984 (Signet Classics)" ...
## $ Author : chr [1:550] "JJ Smith" "Stephen King" "Jordan B. Peterson" "George Orwell" ...
## $ User Rating: num [1:550] 4.7 4.6 4.7 4.7 4.8 4.4 4.7 4.7 4.7 4.6 ...
## $ Reviews : num [1:550] 17350 2052 18979 21424 7665 ...
## $ Price : num [1:550] 8 22 15 6 12 11 30 15 3 8 ...
## $ Year : num [1:550] 2016 2011 2018 2017 2019 ...
## $ Genre : chr [1:550] "Non Fiction" "Fiction" "Non Fiction" "Fiction" ...
## - attr(*, "spec")=
## .. cols(
## .. Name = col_character(),
## .. Author = col_character(),
## .. `User Rating` = col_double(),
## .. Reviews = col_double(),
## .. Price = col_double(),
## .. Year = col_double(),
## .. Genre = col_character()
## .. )
## - attr(*, "problems")=<externalptr>
dim(df)
## [1] 550 7
#Descriptive statistical analysis, including calculating the mean, median, and summary information
mean(df$Reviews)
## [1] 11953.28
median(df$Reviews)
## [1] 8580
summary(df)
## Name Author User Rating Reviews
## Length:550 Length:550 Min. :3.300 Min. : 37
## Class :character Class :character 1st Qu.:4.500 1st Qu.: 4058
## Mode :character Mode :character Median :4.700 Median : 8580
## Mean :4.618 Mean :11953
## 3rd Qu.:4.800 3rd Qu.:17253
## Max. :4.900 Max. :87841
## Price Year Genre
## Min. : 0.0 Min. :2009 Length:550
## 1st Qu.: 7.0 1st Qu.:2011 Class :character
## Median : 11.0 Median :2014 Mode :character
## Mean : 13.1 Mean :2014
## 3rd Qu.: 16.0 3rd Qu.:2017
## Max. :105.0 Max. :2019
#Descriptive statistical analysis using the dplyr package to group data by Reviews and calculate the mean and median of the rating
library(dplyr)
##
## Attaching package: 'dplyr'
##
## The following objects are masked from 'package:stats':
##
## filter, lag
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
summary_table <- df %>%
group_by(Reviews) %>%
summarise(mean_value = mean(`User Rating`), median_value = median(`User Rating`))
print((summary_table))
## # A tibble: 346 × 3
## Reviews mean_value median_value
## <dbl> <dbl> <dbl>
## 1 37 4.6 4.6
## 2 220 4.6 4.6
## 3 408 4.5 4.5
## 4 438 4.5 4.5
## 5 440 4.4 4.4
## 6 460 4.6 4.6
## 7 471 4.5 4.5
## 8 491 4.2 4.2
## 9 548 4.8 4.8
## 10 615 4.7 4.7
## # ℹ 336 more rows
#Since the Reviews data represents the cumulative total over the years, the average annual Reviews data is calculated as a proxy variable for annual sales volume.
item_counts <- as.data.frame(table(df$Name))
df <- merge(df, item_counts, by.x = "Name", by.y = "Var1")
df$AverageReviews <- df$Reviews / df$Freq
#Split the data frame into two separate data frames for fiction and non-fiction books, and conduct separate analyses for each
df_Fiction <- df[df$Genre == "Fiction", ]
df_non <- df[df$Genre != "Fiction", ]
Data visualization can help us discover relationships between these data, thereby facilitating the next step of mathematical modeling.
#Data visualization
library(ggplot2)
ggplot(df) +
geom_point(mapping = aes(x = Price, y =AverageReviews,color=`User Rating`)) +facet_wrap(~ Genre)
labs(title = "Relationship between Price and Review",
x = "Price",
y = "Number of Reviews") +
theme_minimal()
## NULL
Since the dataset does not include sales volume data, we can only use Reviews as a proxy for book sales (these two data should be highly correlated. Of course, if sales volume data can be obtained, the model parameters can be estimated more accurately). Based on our previous calculations, AverageReviews represents the average annual Reviews, and thus can also serve as a proxy variable for annual book sales. The graphs show some differences between fiction and non-fiction books. Some fiction books with low ratings still have high sales volumes, indicating that fiction readers are more emotional and do not fully rely on ratings when purchasing. This reflects the Chinese saying, “there is no first in literature.” On the other hand, non-fiction readers are more rational, and as ratings increase, so does the AverageReviews, indicating that sales volume should also increase. For non-fiction books, increasing prices regardless of rating leads to a decrease in AverageReviews (annual sales volume).
Based on the results of the above data visualization, we construct the following regression model for non-fiction data: AverageReviews=b1Price+b2User Rating+error
#Run a multiple regression algorithm and display the regression results and confidence intervals.
model <- lm(AverageReviews ~ Price+`User Rating`+0, data = df_non)
summary(model)
##
## Call:
## lm(formula = AverageReviews ~ Price + `User Rating` + 0, data = df_non)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4868 -2667 -1136 1175 25739
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## Price -61.48 18.65 -3.296 0.00109 **
## `User Rating` 1146.60 77.46 14.803 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3980 on 308 degrees of freedom
## Multiple R-squared: 0.5548, Adjusted R-squared: 0.5519
## F-statistic: 191.9 on 2 and 308 DF, p-value: < 2.2e-16
confint(model)
## 2.5 % 97.5 %
## Price -98.17679 -24.78102
## `User Rating` 994.18823 1299.02146
So, the estimated mathematical model we obtained is as follows: AverageReviews = -61.48 * Price + 1146.60 * User Rating + error This means that for non-fiction books, for every one-point increase in rating, the average number of annual reviews increases by approximately 1147, while for every one-dollar increase in price, the average number of annual reviews decreases by approximately 61. Therefore, an increase in price leads to a decrease in the number of reviews (sales volume). This is consistent with the basic principles of market economics: books with better ratings sell more at the same price, and books with the same rating sell more at lower prices. The R-squared of this model is 0.5548, which although not very high, is acceptable in the social science field due to the difficulty of accurate prediction and the use of cross-sectional data. Of course, if additional information about these books can be obtained, the R-squared can be further improved, resulting in more precise predictions. At the 99% confidence level, both coefficients are significant, indicating that there is a 99% probability that the two coefficients are not zero overall, and that price and rating have an impact on the number of reviews (sales volume). At the 95% confidence level, the price parameter ranges from -98.18 to -24.78, and the rating parameter ranges from 994.19 to 1299.02. Therefore, our pricing strategy below should be robust.
Treating AverageReviews as annual sales, the current annual sales revenue for non-fiction books is USD 23,899,308.8 (calculated by multiplying the AverageReviews column by the Price column and summing the results). However, due to a lack of platform regulation, there is currently excessive price competition among books. For example, the book “The Constitution of the United States” has a User Rating of 4.8 but is priced at zero. Although it has 2774 Reviews, indicating that at least 2774 books have been sold, the sales revenue is zero because the price is zero. Since Amazon’s platform royalty is uniformly set at 70%, which means the platform takes a 30% cut, Amazon does not earn any profit from the sale of this book as 0 * 30% is still 0. Assuming Amazon regulates book prices, for example, setting the price of the lowest-rated book at 3.3 to 1 dollar, the predicted sales volume based on the model would be -61.48 * 1 + 1146.60 * 3.3 = 3722 books. Next, we need to determine a set of prices that would result in annual sales of 3722 books for all ratings. Using the mathematical model above, we can calculate the pricing for each User Rating level. Letting Price be denoted as P, AverageReviews as Q, the model can be rewritten as: P = -20758.88/48.51 + 5614.87/48.51 * User Rating - 1/48.51 * Q Based on this, we can calculate the following pricing table: Rating Price 4.9 31 4.8 29 4.7 27 4.6 25 4.5 23 4.4 22 4.3 20 4.2 18 4.1 16 4.0 14 Under this pricing strategy, we recalculate the annual sales revenue for non-fiction books by multiplying the new price column by the annual sales column (which are now all close to 3722) and summing the results, obtaining USD 28,985,033.46. This represents an increase of USD 5,085,724.66 or 21.27% compared to the unregulated situation. Amazon, taking a 30% cut, can also increase its revenue and profit by 21.27% since the regulation can be set within the computer system without increasing the company’s labor costs. Of course, with more data, we can predict prices more accurately. Some books have low ratings but high prices and still sell very well. If we can identify the reasons for their popularity, there may be room for price increases for this category of books. This would allow for better macro-regulation and enable Amazon to earn more profits.