Hospitality Analytics: A Strategic Roadmap to Elevated Guest Experiences

This piece of work focuses on a data set containing information regarding hotel customers and their responses to a survey indicating their satisfaction levels with various hotel services. Also included in the dataset is information regarding the customers spending habits, their rewards status (designated NoStatus, Silver, Gold, Platinum), as well as generic information such as length of stay, purpose of visit, distance travelled etc.
The purpose of this analysis is four fold.
(1) Firstly, an attempt will be made to see if any of the satisfaction variables are impacting overall satisfaction more than others (since overall satisfaction is an important measure for the hotel to track). Using the regressions we can create a basic linear programming model to help inform spending decisions given a series of hypothetical constraints.
(2) Secondly, elite status will be examined to see if any groups are more or less satisfied (theoretically we should expect to see Platinum customers the most satisfied and nostatus the least etc).
(3) Thirdly, total customer spending will be calculated (feature engineering). This figure will be useful for several reasons most notably (a) visualising the different spending patterns of rewards customers (b) are visitors for specific events spending more or less than others?
(4) Final section to explore any further insights gained from analysis in previous sections.

Installing relevent packages

hotel_data

install.packages(‘dplyr’)

install.packages(‘stargazer’)

install.packages(‘ggplot2’)

install.packages(‘tidyr’)

install.packages(“rlang”)

Loading libraries

library(dplyr)

library(stargazer)

library(ggplot2)

library(tidyr)

library(rlang)

Converting necessary variables to factors

hotel_data\(eliteStatus = factor(hotel_data\)eliteStatus) hotel_data\(visitPurpose = factor(hotel_data\)visitPurpose)

(1)

Visualizing average value of Satisfaction Variables

satisfaction_data_long <- hotel_data %>% gather(key = “SatisfactionVariable”, value = “Score”, starts_with(“sat”))

satisfaction_means <- satisfaction_data_long %>% group_by(SatisfactionVariable) %>% summarise(MeanScore = mean(Score, na.rm = TRUE))

plot_0 <- ggplot(satisfaction_means, aes(x = SatisfactionVariable, y = MeanScore, fill = MeanScore)) + geom_col() + scale_fill_gradient(low = “lightblue”, high = “blue”) + labs(title = “Mean Customer Satisfaction Scores”, x = “Satisfaction Variables”, y = “Mean Score”) + theme(plot.title = element_text(hjust = 0.5), # Center the title panel.background = element_blank(), # Remove background axis.text.x = element_text(angle = 90, vjust = 0.5)) # Adjust x-axis labels

Highest average scores appear to be satisfaction with the proximity of events, the front staff, the price paid for parking, and the perks. Further investigation needed to define specifics.

Checking distribution of satisfaction variables

plot1 = ggplot(satisfaction_data_long, aes(x = Score)) + geom_histogram(bins = 30, fill = “blue”, color = “black”) + facet_wrap(~ SatisfactionVariable, scales = “free_x”) + labs(title = “Distribution of Satisfaction Scores”, x = “Score”, y = “Frequency”)

Plots indicate normal distribution

Checking remaining variables

non_satisfaction_data <- hotel_data %>% select_if(is.numeric) %>% select(-starts_with(“sat”))

Reshape the data into a long format

non_satisfaction_data_long <- non_satisfaction_data %>% pivot_longer(cols = everything(), names_to = “Variable”, values_to = “Value”)

Plot histograms for each variable

plot2 = ggplot(non_satisfaction_data_long, aes(x = Value)) + geom_histogram(bins = 30, fill = “blue”, color = “black”) + facet_wrap(~ Variable, scales = “free_x”) + labs(title = “Distribution of Various Hotel Variables”, x = “Value”, y = “Frequency”)

Distributions of avgFoodSpendPerNight, distanceTraveled and nightsStayed are all positively skewed. Will need transformation before linear regression can be performed.

Transforming (constant added to account for zero values)

hotel_data\(log_avgFoodSpendPerNight <- log(hotel_data\)avgFoodSpendPerNight + 1) hotel_data\(log_distanceTraveled <- log(hotel_data\)distanceTraveled + 1) hotel_data\(log_nightsStayed <- log(hotel_data\)nightsStayed + 1)

transformed_data_long <- hotel_data %>% select(log_avgFoodSpendPerNight, log_distanceTraveled, log_nightsStayed) %>% pivot_longer(cols = everything(), names_to = “TransformedVariable”, values_to = “TransformedValue”)

plot3 <- ggplot(transformed_data_long, aes(x = TransformedValue)) + geom_histogram(bins = 30, fill = “blue”, color = “black”) + facet_wrap(~ TransformedVariable, scales = “free_x”) + labs(title = “Distribution of Log-Transformed Variables”, x = “Log-Transformed Value”, y = “Frequency”)

Checking correlations between satisfaction variables through visualisation

install.packages(“corrplot”)

library(corrplot)

satisfaction_vars <- hotel_data %>% select(starts_with(“sat”))

corr_matrix <- cor(satisfaction_vars, use = “complete.obs”)

Plotting parameters with further reduced coefficient text size

corplot1 <- corrplot(corr_matrix, method = “color”, type = “upper”, order = “hclust”, tl.col = “black”, tl.srt = 45, tl.cex = 0.6, addCoefAsPercent = FALSE)

Plot indicates relatively high degree of correlation between overall satisfaction and satisfaction with the front staff, elite perks, cleanliness of the room and the dining price.

These variables will be the focus of our regression analysis.

l_mod1 <- lm(satOverall~satCleanRoom + satFrontStaff + satPerks + satDiningPrice, data=hotel_data)

l_mod1sum <- stargazer(l_mod1,type=“text”)

Model is intriguing. R-squared value indicates that roughly 30.57% of the variability in overall satisfaction is explained by the model (and the four selected variables). • p-value statistically significant across all predictors at relevent significance levels. • High f-stat (164.6 on 4 and 1495 degrees of freedom).

While model useful - not appropriate for use as a predictive tool. R squared value too low.

Takeaway for hotel - if their aim is to maximise overall customer satisfaction they should focus on improving the cleanliness of their rooms, front staff training, the perks associated with elite membership and the satisfaction with Dining Price.

Using the coefficients we have generated, we can build a basic linear programming model to help inform the hotel as to how to spend money in order to improve overall customer satisfaction.

MAXz = 0.31(x1) + 0.13(x2) + 0.13(x3) +0.16*(x4).

MAXz represents the attempt to maximise overall customer satisfaction. x1 (front staff), x2 (cleanliness of room), x3 (dining price), and x4 (elite perks) represent our four explanatory variables.

We can also assume some constraints for the business. For example, there may be budgetary constraints for some variables.

There may only be $10,000 to be spent on front staff training in which case

• X1 <= $10,000 •

There may only be $5000 to be spent on cleaning staff training in which case

• X2 <= $5000 •

There may only be a total staff training budget of $12,500 in which case

• X1 + X2 <= $12,500 •

The business may decide that there is a minimum level of satisfaction they will accept for customer’s elite perks (for example, 4 out of 7) , in which case

• X4 >= 4 •

These are merely some theoretical examples of potential constraints the business may face. In reality, figuring out how many constraints there would be is a far more intensive process that requires a great deal of analysis.

In all likelihood, the number of constraints a business will face would be far greater in number and complexity than those presented here.

(2)

We will now examine EliteStatus and its impacts on customers. As acknowledged earlier, we would expect to see a positive relationship between overall satisfaction and the level of elite status.

install.packages(‘stats’) library(stats)

anova_model1 <- aov(satOverall ~ eliteStatus, data = hotel_data)

TukeyHSD(anova_model1)

High f-stat and low p-val indicate strong stastical significance across elite status levels.

Tukey HSD test used to determine specifics of relationship.

Results confirm expectation that platinum customers are the most satisfied (followed by Gold, Silver and NoStatus).

Using violin plot to visualize kernel density.

plot4 <- ggplot(hotel_data, aes(x = eliteStatus, y = satOverall, fill = eliteStatus)) + geom_violin(trim = FALSE, color = “blue”) + scale_fill_manual(values = c(“lightblue”, “blue”, “deepskyblue”, “royalblue”)) + labs(title = “Overall Satisfaction by Elite Status”, x = “Elite Status”, y = “Overall Satisfaction”) + theme_minimal() + # Removes background and applies a minimal theme theme(plot.title = element_text(hjust = 0.5), # Center the title legend.title = element_blank()) # Remove the legend title

Plot shows:

• Platinum members are most likely to score their overall satisfaction a 6 or higher – as expected.

• Platinum members also have a reasonably well spread out set of values, with no single score standing out (unlike for Gold and NoStatus where 4 is the most common score).

• No Platinum or Gold members rated their overall satisfaction as a 1.

(3)

Recorded on the survey is the reason for each customers visit. These are split into the following categories:

• Business

• Concert

• Conference

• OtherorMixed

• SportsEvent

• Vacation.

Firstly we can examine whether there is a marked difference in the average spending of these groups

Creating new variable by adding together room spending per night, food spending per night and wifi spend per night - multiplied by nightsStayed.

hotel_data\(totalcustomerspend=(hotel_data\)avgRoomSpendPerNight+hotel_data\(avgFoodSpendPerNight+hotel_data\)avgWifiSpendPerNight)*hotel_data$nightsStayed

Aggregating data to get average spend per visit purpose

average_spend_per_purpose <- hotel_data %>% group_by(visitPurpose) %>% summarise(AverageSpend = mean(totalcustomerspend, na.rm = TRUE))

Creating a bar chart

plot5 <- ggplot(average_spend_per_purpose, aes(x = visitPurpose, y = AverageSpend, fill = visitPurpose)) + geom_bar(stat = “identity”) + scale_fill_manual(values = c(“lightblue”, “blue”, “deepskyblue”, “royalblue”, “skyblue”, “dodgerblue”)) + labs(title = “Average Total Customer Spend by Visit Purpose”, x = “Visit Purpose”, y = “Average Total Spend”) + theme_minimal() + theme(plot.title = element_text(hjust = 0.5), axis.text.x = element_text(angle = 45, hjust = 1), legend.title = element_blank())

Takeaways for Hotel • The average total spend is relatively consistent across the six different visitpurpose categories • Those on vacation tend to spend the most, while those travelling for business, or a sports event spend the least.

Running a regression model to see if relationship between any satisfaction variables and totalcustomerspend.

l_mod2 <- lm(totalcustomerspend~satCleanRoom + satFrontStaff + satPerks + satDiningPrice + satCleanBath + satCleanCommon + satDiningStaff + satHouseStaff + satValetStaff + satRoomPrice + satWifiPrice + satParkingPrice + satCloseTransp + satCloseEvents + satPoints + satRecognition + satOverall, data= hotel_data)

summary(l_mod2)

No significant relationship. Perhaps at odds with what might be expected, as one would generally expect there to be some sort of linear relationship between for example overall satisfaction and total customer spending.

(4)

By cross referencing visitpurpose and elitestatus we can visualize to see if any sub groups are spending markedly more than others

average_spend_by_purpose_status <- hotel_data %>% group_by(visitPurpose, eliteStatus) %>% summarise(AverageSpend = mean(totalcustomerspend, na.rm = TRUE))

plot6 <- ggplot(average_spend_by_purpose_status, aes(x = visitPurpose, y = AverageSpend, fill = eliteStatus)) + geom_bar(stat = “identity”, position = position_dodge()) + coord_flip() + labs(title = ““, x =”Visit Purpose”, y = “Average Total Spend”) + scale_fill_brewer(palette = “Blues”) + theme_minimal() + theme(plot.title = element_text(hjust = 0.5))

This visualization offers some fantastic insights. Most notably that those visiting the hotel for other or mixed reasons are by far and away the highest spenders. This is most obvious among platinum customers.

As such:

• The hotel can now focus aggressively on targeting these specific customers with marketing content and offers

• Less time can be dedicated to customers not likely to spend money – such as Platinum/SportsEvent customers.

End

```