Assignment - Booking.com Analysis

Author

Aaron O’Malley

Introduction

Booking.com stands as a key player in connecting millions of travelers with diverse hotel options worldwide. This data analysis aims to showcase insights into hotel bookings on Booking.com, exploring patterns and trends that shed light on consumer behavior, preferences, and broader industry dynamics.

This data analysis will look further into travelers visting Ireland, breaking it down by Gender, Age, Expenditure, Country of Origin, Preferred Payment Methods and Hotel Performance.

Gender

library(tidyverse)
library(gridExtra)
library(kableExtra)

hotel_bookings <- read_csv("hotel_bookings.csv")

ireland <- filter(hotel_bookings, destination_country == "Ireland")
gender <- ireland %>%
  select(gender) %>%
  group_by(gender) %>%
  summarise(number = n())

pie_sections <- c(1607, 1709)
lbls <- c("Female", "Male")
pie_percent <- round(pie_sections/sum(pie_sections)*100, 1)

pie(pie_sections, labels = pie_percent, main = "Gender of Visitors to Ireland",col = rainbow(length(pie_sections)))
legend("topright", c("Female","Male"), cex = 0.8,
       fill = rainbow(length(pie_sections)))

Our first set of data analysis is to learn more about our customers visiting Ireland. As we can see from the pie chart above, there is a balanced distribution of both Male (51.5%) and Female (48.5%). This data is useful as it suggests that we need to inclusively cater to our customers in all areas of business.

Age

ireland <- mutate(ireland, age_group = case_when(
  age >= 19 & age < 30 ~ "19-29",
  age >= 30 & age < 40 ~ "30-39",
  age >= 40 & age < 50 ~ "40-49",
  age >= 50 ~ "50+"))

ggplot(data = ireland) +
  geom_bar(mapping = aes(x = fct_infreq(age_group), fill = age_group)) +
  scale_fill_manual(values = c("navy", "lightblue", "blue", "gray")) +
  labs(title = "Visitors to Ireland by Age",
       x = "Age", y = "Users", fill = "Age Group") +
  theme_classic()

The bar chart highlights the density of users by age group showing 19-29 being the highest amount of users, followed by 40-49, 30-39 and 50+.

Understanding the popularity of these age groups is important so we can tailor our content and marketing towards these audiences which will resonate more with them. This will increase engagement and sales.

Age Groups can also help with how we manage our user experience (UX) by aligning strategies that resonate with those age demographics. Overall boosting customer satisfaction.

Expenditure by Age Group

ggplot(data = ireland) +
  geom_point(mapping = aes(x = age, y = booking_price), colour = "blue")+
  facet_wrap(~ age_group, nrow = 2)+
  labs(title = "Booking Expenditure by Age Group",
       x = "Age", y = "Booking Price")+
  theme_bw()

The facet wrap scatterplot visually represents expenditure by age group, shows a visual representation of age-related spending dynamics revealing a pattern where younger people have a higher spending compared to older people. This trend provides valuable insights into the relationship between age and expenditure within the analyzed context. This data can help target and capitalise on the observed consumer behaviors.

Origin Countries of Visitors to Ireland

ggplot(data = ireland) +
  geom_bar(mapping = aes(x = fct_infreq(origin_country), fill = origin_country)) +
  scale_fill_manual(values = c("red", "gray", "navy", "orange", "pink","darkred", "yellow")) +
  theme_classic() +
  labs(title = "Origin Countries of Visitors to Ireland",
       x = "Number of Visitors", y = "Origin Country", fill = "Origin Country")

This bar-chart effectively visualises the density of visitors to Ireland from different origin countries, providing valuable insights for tourism and businesses. This analysis helps to understand the diverse sources of tourism traffic, allowing for targeted strategies to enhance the visitor experience and promote Ireland as a destination of choice.

Preferred Payment Method

payment <- ireland %>%
  select(payment_method) %>%
  group_by(payment_method) %>%
  summarise(number = n())

payment <- payment %>%
  arrange(desc(payment_method)) %>%
  mutate(percent = round(number / sum(payment$number) *100, 1)) %>%
  mutate(ypos = cumsum(percent)- 0.5*percent )

ggplot(payment, mapping =  aes(x = "", y = percent, fill = payment_method)) +  
  geom_col(width=1) +  
  coord_polar("y", start=0)+  
  theme_void()+  
  labs(title = "Preferred Payment Method Ireland",      
       x = "",
       y = "Payment Method",
       fill = "Payment Method")+  
  geom_label(data = payment, aes(y = ypos, label = paste0(percent, "%")), color = "white", size=6) +  
  scale_fill_brewer(palette="Set1")

This pie chart provides an insightful representation of the preferred payment methods to Visitors in Ireland, showcasing the distribution among different options. Each slice of the pie corresponds to a specific payment method. This is valuable to us and our registered businesses to be able to accommodate popular and preferred payment types.

The coexistence of various payment options underscores the importance of offering a versatile and user-friendly payment experience to accommodate the preferences of a wide-ranging audience in Ireland.

Number of Days Stayed in Hotels in Ireland

stay <- ireland %>%
  select(num_days) %>%
  group_by(num_days) %>%
  summarise(number = n())

ggplot(data = stay) +
  geom_histogram(mapping = aes(x = number), binwidth = 50, fill = "blue")+
  labs(title = "Number of Days stayed in Hotels in Ireland",
       x = "Number of Days",
       y = "Guests")+
  theme_classic()

This histogram shows that majority of guests spend 1-10 days at a hotel, which then gets more sparse as days go on, with a peculiar outlier just under 1500 days!

Booking Price by Hotel Rating

ireland <- ireland %>%
  rename(score = hotel_rating) %>%
  mutate(ireland, rating = case_when(
  score >= 3 & score < 3.5 ~ "Fair",
  score >= 3.5 & score < 4 ~ "Good",
  score >= 4 & score < 4.5 ~ "Very Good",
  score >= 4.5 ~ "Excellent"))

ggplot(data = ireland) +
  geom_boxplot(mapping = aes(x = rating, y = booking_price),
               outlier.shape = 20, outlier.color = "blue") +
  labs(title = "Booking Price by Hotel Rating",
       x = "Hotel Rating", y = "Booking Price") +
  theme_classic()

This boxplot helps understand the distribution of different hotel booking prices, in different hotel ratings. Boxplots emphasize the spread of pricing, median pricing, outliers, comparisons, skewness and overall trends.

We can see from the boxplot that the higher the hotel rating, the more variety in booking prices.

Top 10 Best Hotels in Ireland

library(kableExtra)

Top10 <- ireland %>%
  arrange(desc(score), booking_price) %>%
  head(10) %>%
  filter(score >= 4.5) %>%
  select(hotel, destination_city, score, rating, booking_price)

Top10[] <- lapply(Top10, function(x) iconv(as.character(x), "UTF-8", "UTF-8", sub = ""))

knitr::kable(Top10,
      col.names = c("Hotel", "City", "Score", "Rating", "€"),
      digits = c(0,0,0,1,2),
      align = "lllrr",
      caption = "Top 10 Hotels in Ireland",
      table.attr = 'data-quarto-disable-processing = "true"') %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, bold = TRUE, color = "white", background = "navy", underline = FALSE) %>%
  row_spec(1:10, background = "lightblue") %>%
  column_spec(1, bold = TRUE, italic = TRUE)
Top 10 Hotels in Ireland
Hotel City Score Rating €
Hotel Da Viva Dublin 4.7 Excellent 201
Magical Motel Galway 4.7 Excellent 269
Sleep Well Motel Tallaght 4.7 Excellent 269
Hello Home Limerick 4.7 Excellent 269
Sunny Canopy Tallaght 4.7 Excellent 286
Bluebird Guesthouse Waterford 4.7 Excellent 286
Breeze Blows Motel Galway 4.7 Excellent 286
Bonnies Balcony Tallaght 4.7 Excellent 286
Westcoast Motels Cork 4.7 Excellent 286
Sleep Well Motel Waterford 4.7 Excellent 308

The table above shows the Top 10 Best Hotels in Ireland. This table is based on a high Score Rating followed by the cheapest price. The list provides a variety of city choices from Dublin, to Waterford. This table makes it easier for customers to compare, increasing awareness and influencing potential sales.

Conclusion:

In conclusion, this comprehensive data analysis provides a deep understanding of hotel bookings on Booking.com, shedding light on consumer behavior, preferences, and industry dynamics. As we delve further into the analysis focusing on travelers visiting Ireland, we uncover valuable insights.

Upon investigation of demographics, expenditure patterns, origin countries, and payment preferences, it became clear that these insights open into guest experiences. Each visualization, from pie charts to histograms, has provided a unique lens through which we can refine our strategies, enhance user experiences, and foster inclusive practices.

Meme:

Me trying to find the missing “,” in my RScript like: