library(tidyverse)
library(dplyr)
library(ggplot2)
library(kableExtra)Hotel Satisfaction
Import Dataset “hotel_satisfaction.csv”
hotel_satisfaction <- read_csv("hotel_satisfaction.csv")General Overview:
- Customers whose elite status is platinum and purpose of visit is ‘Sports Event’ seem to be travelling the most to stay at the client’s hotel
hotel_satisfaction <- mutate(hotel_satisfaction, TotalMoneySpentOnStay =(avgRoomSpendPerNight + avgFoodSpendPerNight + avgWifiSpendPerNight)*nightsStayed)
y = hotel_satisfaction %>%
group_by(visitPurpose, eliteSegment) %>%
summarise(mean_distance = mean(distanceTraveled), mean_satOverall = mean(satOverall), mean_TotalMoneySpentOnStay = mean(TotalMoneySpentOnStay))
ggplot(y, aes(visitPurpose, mean_distance, fill = mean_distance)) +
geom_bar(stat = "identity", position = position_dodge()) +
coord_flip() +
scale_fill_gradient(low = "lightblue", high = "darkblue") +
labs(title = "Average distance traveled based on purpose of visit and elite status")- With the help of this bar-chart we can see that people who has a Business purpose of visit usually staying in the Platinum and Gold rooms. And people whose purpose of visit is Vacation are staying in the rooms with NonStatus or Silver. It might be because they are staying for more nights and the Gold and Platinum rooms would be more expensive to stay.
ggplot(hotel_satisfaction, aes(x = eliteSegment, fill = visitPurpose)) +
geom_bar(alpha = 0.9, position = "identity") +
scale_fill_manual(values = c("Business" = "#bbeeff", "Concert" = "#99ccff", "Conference" = "#5588ff", "OtherOrMixed" = "#0b517c", "SportsEvent" = "#000d6f", "Vacation" = "#7200ea")) +
labs(title = "Bar Plot of visitPurpose by Elite Segment",
x = "eliteSegment",
y = "Count")- Customers that traveled for a Vacation remained longer than others. Customers who remained because of the Conference stayed for a shorter period of time than others.
ggplot(hotel_satisfaction, aes(x = visitPurpose, y = nightsStayed)) +
geom_boxplot(fill = "navy", color = "black") +
geom_jitter(position = position_jitter(width = 0.2), color = "lightblue", alpha = 0.5) +
labs(title = "Boxplot of Nights Stayed by Visit Purpose",
x = "Visit Purpose",
y = "Nights Stayed") +
theme_minimal() #I applied new programs, such as geom_jitter, to jitter the data points on top of the boxplot, which make it easier to see each of the data points.- On this table we can see the total among of night people stayed in the hotel by the Visit Purpose.
night_stayed_by_Visit_purpose <- hotel_satisfaction %>%
group_by(visitPurpose) %>%
summarise(total_nightstayed = sum(nightsStayed)) %>%
arrange(desc(total_nightstayed))
knitr::kable(night_stayed_by_Visit_purpose,
digits = c(0, 0),
align = "lr",
col.names = c("Visit Purpose", "Total Nights Stayed"),
caption = "Total Nights Stayed by Visit Purpose") %>%
kable_styling(full_width = F) %>%
row_spec(0, bold = TRUE, color = "beige", background = "navy") %>%
column_spec(1, bold = TRUE, color = "navy") %>%
column_spec(2, italic = TRUE)| Visit Purpose | Total Nights Stayed |
|---|---|
| Business | 1408 |
| SportsEvent | 1287 |
| Vacation | 840 |
| Conference | 755 |
| Concert | 712 |
| OtherOrMixed | 658 |
- By creating the Membership Level bar-chart we can see that more people staying at the rooms with NoStatus or Silver.
ggplot(data = hotel_satisfaction, aes(eliteSegment, fill = eliteSegment)) +
geom_bar() +
geom_text(
aes(label = stat(count), group = eliteSegment),
stat = "count",
position = position_dodge(0.9),
vjust = -0.5,
color = "black",
size = 3
) +
scale_fill_manual(values = c("#87CEEB", "#6495ED", "#4169E1", "#1E90FF")) + # Adjust colors as needed
labs(x = "Room Status") +
ggtitle("Membership level")Conclusion to the general overview:
We can observe that even on the Box-Plot, persons who remained in a hotel during their holiday stayed for more than 10 nights, which is less than the total number of nights stayed during the business’s stay. However, the number of people who stayed in Platinum or Gold rooms for the purpose of “Business” is still lower than the number of people who stayed in rooms with “NoStatus” and “Silver” (as seen in the “MemeberShip Level” barchart).
Customer’s Overall Satisfaction:
- The first bar chart will show as the average satisfaction of customers based on the Status of their room and visit of purpose. We can see that people who are stayed in the Platinum room are mostly satisfied. The most interesting from this table is that people whose visit purpose is OtherOrMixed. The second one most satisfied are people who stayed in hotel on the Business trip. Also it is quite obvious that the least satisfied room was NoStatus.
ggplot(y, aes(x = visitPurpose, y = `mean_satOverall`, fill = eliteSegment)) +
geom_bar(stat = "identity", position = position_dodge()) +
scale_fill_manual(values = c("Gold" = "#bbeeff", "NoStatus" = "#99ccff", "Platinum" = "#5588ff", "Silver" = "#0b517c")) +
labs(title = "Average satisfaction level of customers based on
purpose of visit and elite status") +
coord_flip()- I can visually compare the distribution of satisfaction ratings within each section by building a histogram with facets depending on EliteSegments.
ggplot(hotel_satisfaction, aes(x = satOverall, fill = eliteSegment)) +
geom_histogram(binwidth = 1, alpha = 0.9, position = "identity") +
facet_wrap(~eliteSegment) +
scale_fill_manual(values = c("Gold" = "#bbeeff", "NoStatus" = "#99ccff", "Platinum" = "#5588ff", "Silver" = "#0b517c")) +
labs(title = "Histogram of satOverall by Elite Segment",
x = "satOverall",
y = "Frequency")- In this graph, I can easily observe the Average Satisfaction depending on each Purpose Visit. Again, it turns out that those who remained due to a business trip are the most satisfied. The Conference, Concert, and OtherOrMixed are all on the same level of enjoyment. Even if the SportsEvent is less satisfied, the number is still not that low.That leads me to the conclusion that overall satisfaction with the purpose of the visit is about average.
visit_purpose_by_sat <- hotel_satisfaction %>%
group_by(visitPurpose) %>%
summarise(mean_satOverall = mean(satOverall)) %>%
arrange(desc(mean_satOverall))
ggplot(visit_purpose_by_sat,aes(visitPurpose, mean_satOverall, fill = visitPurpose)) +
geom_bar(stat="identity", position=position_dodge()) +
scale_fill_manual(values = c("Business" = "#bbeeff", "Concert" = "#99ccff", "Conference" = "#5588ff", "OtherOrMixed" = "#0b517c", "SportsEvent" = "#000d6f", "Vacation" = "#7200ea")) +
geom_text(aes(label = sprintf("%.2f", mean_satOverall)), position = position_dodge(width = 0.9), vjust = -0.5) +
labs(title = "Average satisfaction level for customers based on their purpose of visit ") - Platinum are quite pleased with the staff and their efforts. They didn’t even set a lower figure for employee satisfaction. NoStatus is dissatisfied with the work of the personnel.
hotel_satisfaction <- mutate(hotel_satisfaction, StaffSat = (satValetStaff + satHouseStaff + satDiningStaff + satFrontStaff))
hotel_satisfaction %>%
tail(10) %>%
ggplot(aes(x = eliteSegment, y = StaffSat)) +
geom_point(shape = 21, color = "black", fill = "navy", size = 6) +
geom_line(color = "grey") +
theme_minimal() +
ggtitle("Staff satisfaction room type")- The average clean satisfaction is most with the Platinum room status.
hotel_satisfaction <- mutate(hotel_satisfaction, CleanSat = (satCleanRoom + satCleanBath + satCleanCommon))
avr_cleansat_by_status <- hotel_satisfaction %>%
group_by(eliteSegment) %>%
summarise(mean_cleansat = mean(CleanSat)) %>%
arrange(desc(mean_cleansat))
knitr::kable(avr_cleansat_by_status,
digits = c(0,2),
align = "lr",
col.names = c("Room Status", "Clean Satisfacyion"),
caption = "Average statisfation of cleaning by the Room Status") %>%
kable_styling(full_width = F) %>%
row_spec(0, bold = T, color = "beige", background = "navy") %>%
column_spec(1, bold = T, color = "navy") %>%
column_spec(2, italic = T)| Room Status | Clean Satisfacyion |
|---|---|
| Platinum | 13.36 |
| Gold | 12.62 |
| Silver | 12.14 |
| NoStatus | 11.52 |
- It is evident that the whole Elite Segment is pleased with the pricing for the accommodation, dining, and WiFi, which is excellent for the hotel. That is, the price is worth the money.
hotel_satisfaction <- mutate(hotel_satisfaction, PriceSat = (satRoomPrice + satDiningPrice + satWifiPrice))
ggplot(hotel_satisfaction, aes(x = eliteSegment, y = PriceSat, fill = eliteSegment)) +
geom_bar(stat = "identity", position = "dodge", alpha = 0.7) +
scale_fill_manual(values = c("Gold" = "#bbeeff", "NoStatus" = "#99ccff", "Platinum" = "#5588ff", "Silver" = "#0b517c")) +
labs(title = "Bar Plot of Price Satisfaction by Elite Segment",
x = "Elite Segment",
y = "Price Satisfaction")Conclusion to the Customer’s Satisfaction:
In this section, I examined the customers’ satisfaction with the hotel service, housekeeping, and overall experience. The most intriguing findings were that “NoStatus” and “Silver” rooms had the highest overall satisfaction, but when I looked particularly at cleaning satisfaction, those two were the lowest. Also, “Gold” and “Platinum” rooms have the highest satisfaction with the staff service. And by the Purpose of visit the highest overall satisfaction had the people who stayed “OtherOrMixed”.
Customer’s Spends in the Hotel
- By creating this table with data we can see how much on average spend people by their visit of purpose. People who stayed for their vacation in the hotel on average spends more than others.
hotel_spend_during_stay <- hotel_satisfaction %>%
group_by(visitPurpose) %>%
summarise(mean_total = mean(TotalMoneySpentOnStay)) %>%
arrange(desc(mean_total))
if (nrow(hotel_spend_during_stay) > 0) {
kable(hotel_spend_during_stay,
digits = c(0, 2),
align = "lr",
col.names = c("Visit Purpose", "Mean Total Spending"),
caption = "Average Total Spending by Visit Purpose") %>%
kable_styling(full_width = F, bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#001F3F") %>%
column_spec(1, bold = TRUE, color = "#001F3F") %>%
column_spec(2, italic = TRUE)
} else {
cat("No data available for table.")
}| Visit Purpose | Mean Total Spending |
|---|---|
| Vacation | 740.95 |
| OtherOrMixed | 727.23 |
| Concert | 716.94 |
| Conference | 700.89 |
| SportsEvent | 674.73 |
| Business | 668.98 |
- We can observe through this Bar-chart that guests who stayed in Silver rooms spent more than others. However, the difference between NoStatus, Gold, and Platinum is not as large as expected.
spend_on_stay_by_room_status <- hotel_satisfaction %>%
group_by(eliteSegment) %>%
summarise(mean_TotalMoneySpentOnStay = mean(TotalMoneySpentOnStay)) %>%
arrange(desc(mean_TotalMoneySpentOnStay))
ggplot(spend_on_stay_by_room_status, aes(eliteSegment, mean_TotalMoneySpentOnStay, fill = eliteSegment)) +
geom_bar(stat = "identity", position = position_dodge()) +
scale_fill_manual(values = c("NoStatus" = "#bbeeff", "Silver" = "#99ccff", "Gold" = "#0b517c", "Platinum" = "#000d6f")) +
geom_text(aes(label = sprintf("%.2f", mean_TotalMoneySpentOnStay)), position = position_dodge(width = 0.9), vjust = -0.5) +
labs(title = "Average satisfaction level for customers based on their purpose of visit " ,
y = "Average Money Spend",
x = "Room Status")Overall Conclusion:
Platinum clients are the most happy in every type of visit (business, sporting event, and so on).
Customers who will visit the hotel for ‘Other or Mixed’ objectives and for ‘Concerts’ appear to represent the client’s target audience. These clients appear to be from surrounding areas because their average distance traveled appears to be the shortest. They are happy and spend the most money throughout their stay. Aside from that, our client should target ‘vacationers,’ as these clients spend the most money throughout their stay.
The company should not place too much emphasis on gaining clients who are visiting for a sporting event. These clients are not from the neighborhood (the average distance traveled is long), and they spend the least amount of money during their stay at the hotel.