library(tidyverse)
library(gghighlight)
hotel_sat <- read_csv("hotel_satisfaction.csv")DATA Report - Hotel satisfaction
Introduction
First, I used the code in the following chunk to load the tidyverse, gghighlight, grid, gridExtra and kableExtra packages and then import our dataset “hotel_satisfaction.csv”.
library(grid)
library(gridExtra)
library(kableExtra)Then, I had to do some modification in my data set:
- I created new variables in the data set hotel_sat with the average of: the cleaning, the staff and the price satisfaction.
- I created new data sets of the cleaning’s rooms, the different areas of the staff, and the categories/activities included in the price.
hotel_sat <- mutate(hotel_sat, mean_cleaning = (satCleanRoom+satCleanBath+satCleanCommon)/3)rooms_cleaning <- select(hotel_sat, satCleanRoom, satCleanBath, satCleanCommon)hotel_sat <- mutate(hotel_sat, mean_staff = (satFrontStaff+satDiningStaff+satHouseStaff+satValetStaff)/4)Staff <- select(hotel_sat, satFrontStaff, satDiningStaff, satHouseStaff, satValetStaff)hotel_sat <- mutate(hotel_sat, mean_price = (satRoomPrice+satDiningPrice+satWifiPrice+satParkingPrice)/4)Price <- select(hotel_sat, satRoomPrice, satDiningPrice, satWifiPrice, satParkingPrice)As the satisfaction of the customers is measured on a scale from 1 to 7, I separated it in 3 categories: Really satisfied, Satisfied and Not really satisfied.
hotel_sat <- mutate(hotel_sat, sat_category = case_when(
satOverall >= 6 ~ "Really Satisfied",
satOverall >= 3 ~ "Satisfied",
TRUE ~ "Not Really Satisfied"))To finish with the modifications, I created a new data set with the number of customers in this hotel that allowed me to know that in total, there are 1500 customers in the data sets.
num_clients <- hotel_sat %>%
summarise(num_customers = n())Observations
Thanks to these new rows and data sets, we can now make some observations on the customers’ satisfaction in this hotel:
ggplot(data = hotel_sat) +
geom_point(mapping = aes(x = distanceTraveled, y = nightsStayed), size = 0.5, colour = "blue") +
labs(title = "Number of nights stayed by Distance traveled",
x = "Distance traveled (km)",
y = "Nights stayed") +
annotate("text", x = 5000, y = 45, label = "That scatterplot shows us that most of the customers \nare living between 0 and 1500km \nand stay between 0 and 10 nights in the hotel.", color = "blue")This information can be explained by the purpose of the visit, indeed, a client will stay more or less nights if he comes from far but also if he comes for business, an event or holidays :
hotel_sat %>%
group_by(visitPurpose) %>%
summarise(num_cust = n()) %>%
ggplot() +
geom_col (mapping = aes(x = num_cust, y = reorder(visitPurpose, num_cust))) +
labs(title = "Number of visits by Purpose",
x = "Number of customers",
y = "Purpose of the visit") +
geom_text(aes(x = num_cust, y = reorder(visitPurpose, num_cust),
label = num_cust), hjust = 1.5, color = "white") That barchart show us that most of the clients come to the hotel for Business (387 customers) and 354 customers came for Sports Event.
Then there are also 209 clients coming for vacations, 199 clients for conferences, 183 clients for concerts and 168 clients came for another reason or mixed.
Price
summarize(hotel_sat, min_price = min(avgRoomSpendPerNight))# A tibble: 1 × 1
min_price
<dbl>
1 119
The minimum price for a room is 119€ per night.
summarize(hotel_sat, mean_price = mean(avgRoomSpendPerNight))# A tibble: 1 × 1
mean_price
<dbl>
1 154.
The average price for a room is 154€ per night.
summarize(hotel_sat, max_price = max(avgRoomSpendPerNight))# A tibble: 1 × 1
max_price
<dbl>
1 199
The maximum price for a room is 199€ per night.
ggplot(data = hotel_sat) +
geom_boxplot(mapping = aes(x = avgRoomSpendPerNight),
outlier.shape = 17, outlier.colour = "purple") +
labs(title = "Average price for a room per night",
x = "Price for a room per night",
y = NULL) +
annotate("text", x = 172, y = 0.22, label = "The mean price is 154€.", color = "purple")This boxplot confirms the calculations above, indeed, we can see that the average price for a night is well 154€. It also shows that most of the customers pay between 145 and 161€ per night.
ggplot(data = hotel_sat) +
geom_point(mapping = aes(x = avgRoomSpendPerNight, y = avgFoodSpendPerNight)) +
facet_wrap(~ sat_category, nrow = 2) +
labs(title = "Average of the Price of the Food and the Room spent by Night by satisfaction categories",
x = "Average of the Price Spent for a Room by night",
y = "Average of the Price Spent on Food by night")Thanks to this plot we can observe that most of the clients are satisfied by the Price of the Room and the Food in the hotel. We can also see that the price spent on food and for the room varies a lot.
Staff Satisfaction
# A tibble: 1 × 1
mean_frontsat
<dbl>
1 3.93
ggplot(data = hotel_sat) +
geom_histogram(mapping = aes(x = satFrontStaff), binwidth = 0.5, fill = "purple") +
labs(title = "Satisfaction of the Front staff",
x = "Front staff Satisfaction",
y = "Number of customers") +
annotate("text", x = 2.5, y = 450, label = "The average satisfaction of \nthe Front Staff is 3.93 on 7", color = "blue") +
gghighlight(satFrontStaff == "4")Thanks to this histogram, we can see that most of the customers gave a score of 4 and 3 out of 7 for the satisfaction of the Front staff.
# A tibble: 1 × 1
mean_diningsat
<dbl>
1 3.67
ggplot(data = Staff) +
geom_histogram(mapping = aes(x = satDiningStaff), binwidth = 0.5, fill = "blue") +
labs(title = "Satisfaction of the Dining staff",
x = "Dining staff Satisfaction",
y = "Number of customers") +
annotate("text", x = 1.5, y = 450, label = "The average satisfaction of \nthe Dining Staff is 3.67 on 7", color = "purple") +
gghighlight(satDiningStaff == "4")In this histogram, we can observe that most of the customers gave a score of 4 and 3 out of 7 for the satisfaction of the Dining staff.
# A tibble: 1 × 1
mean_housesat
<dbl>
1 4.32
ggplot(data = Staff) +
geom_histogram(mapping = aes(x = satHouseStaff), binwidth = 0.5, fill = "cyan") +
labs(title = "Satisfaction of the House staff",
x = "House staff Satisfaction",
y = "Number of customers") +
annotate("text", x = 6.5, y = 450, label = "The average satisfaction of \nthe House Staff is 4.32 on 7", color = "blue") +
gghighlight(satHouseStaff == "4")Thanks to this histogram, we can see that most of the customers gave a score of 4 and 5 out of 7 for the satisfaction of the House staff.
# A tibble: 1 × 1
mean_valetsat
<dbl>
1 3.72
ggplot(data = Staff) +
geom_histogram(mapping = aes(x = satValetStaff), binwidth = 0.5, fill = "lightgreen") +
labs(title = "Satisfaction of the Valet staff",
x = "Valet staff Satisfaction",
y = "Number of customers") +
annotate("text", x = 5.5, y = 450, label = "The average satisfaction of \nthe Valet Staff is 3.72 on 7", color = "purple") +
gghighlight(satValetStaff == "4")In this histogram, we can observe that most of the customers gave a score of 4 and 3 out of 7 for the satisfaction of the Valet staff.
Thanks to these histograms, we can observe that the House Staff is the category of the staff that satisfies the most of customers with an average of 4.32 on 7.
It is followed by the Front Staff with an average of 3.93/7 and the Valet Staff with 3.72/7.
The Staff the less satisfying is the Dining Staff with an average of 3.67 on 7.
Overall Satisfaction
ggplot(data = hotel_sat) +
geom_histogram(mapping = aes(x = satOverall), binwidth = 0.5, fill = "cyan") +
labs(title = "Evaluation of the overall satisfaction",
x = "Overall Satisfaction",
y = "Number of customers") +
annotate("text", x = 5.3, y = 500, label = "More than 500 customers \nscored 4 out of 7", color = "blue") +
gghighlight(satOverall == "4")We can see on this histogram that most of the customers scored the overall satisfaction 4 out of 7.
ggplot(data = hotel_sat) +
geom_bar(mapping = aes(x = fct_infreq(sat_category), fill = sat_category), position = "dodge") +
scale_fill_manual(values = c("pink", "cyan", "lightgreen")) +
labs(title = "Satisfaction by category",
x = "Categories",
y = "Number of customers")Thanks to this barchart, we can see that a big majority of the customers are satisfied, indeed, around 1240 customers are in this category. Followed by far with 125 customers that are not really satisfied and over 125 customers are not really satisfied.
table1 <- hotel_sat %>%
group_by(eliteSegment) %>%
summarise(num_customers = n()) %>%
arrange(desc(num_customers))
knitr::kable(table1,
digits = 0,
align = "lr",
col.names = c("Elite Segment", "Number of customers"),
caption = "Repartition of the Elite Segment",
table.attr = 'data-quarto-disable-processing = "true"') %>%
kable_styling(full_width = F) %>%
row_spec(0, bold = TRUE, underline = TRUE, color = "white", background = "purple") %>%
column_spec(1, bold = TRUE, italic = TRUE) %>%
row_spec(1:4, background = "pink")| Elite Segment | Number of customers |
|---|---|
| NoStatus | 544 |
| Silver | 504 |
| Gold | 304 |
| Platinum | 148 |
This table allows us to observe that the biggest category of customers do not have any status, with over 544 customers in this case.
But it is closely followed by the silver category with 504 customers.
The 3rd category the most common is Gold with around 304 customers and the last one is Platinum with around 148 customers.
Conclusion
The main purposes for the customers to come in the hotel are for the business or to assist to a Sport event.
The average price for a room is 154€ and most of the customers are satisfied about this price.
We have observed that House staff are more competent than Dining staff that are less competent.
Then we saw that 1240 customers are satisfied on 1500 customers in the data set.
And to finish, most of the clients do not have any status / elite segment or are in the silver segment.