In the ever-evolving landscape of the culinary industry, opening a restaurant requires a nuanced understanding of various factors that contribute to its success. A prospective restaurateur, eager to navigate the complex realm of food service, has embarked on a comprehensive survey to unravel the critical elements that determine the triumph of a dining establishment.
This survey revolves around six key criteria, each meticulously selected to gauge and comprehend the multifaceted nature of the restaurant business. The restaurateur aims to delve into customer satisfaction with delivery services, strategically identify the most suitable areas for restaurant establishment based on delivery time, and ascertain the influence of location on the overall success of the venture.
To classify restaurants into distinct categories, the survey will focus on two pivotal aspects: customer satisfaction with the quality of food and the efficiency of delivery services. These aspects will help categorize establishments into the ‘Pro’ and ‘Ordinary’ classes, enabling the restaurateur to make informed decisions about the positioning and operational strategy of their future business.
Furthermore, the survey seeks to unravel the intricate relationship between order quantity and delivery time. Understanding the impact of order volume on the timely delivery of food is paramount for optimizing operational efficiency and ensuring customer satisfaction.
In addition to operational considerations, the survey will explore the nuanced preferences of diners concerning the choice of cuisine. The restaurateur recognizes the pivotal role that culinary offerings play in customer reception and aims to uncover how the selection of cuisine can influence the overall dining experience.
With these six criteria as the foundation, the survey endeavors to provide the restaurateur with a comprehensive understanding of the dynamic restaurant industry. Armed with valuable insights, the prospective business owner can make informed decisions regarding the class of their restaurant, the optimal location for establishment, and the strategic choices that will define their culinary venture. Through this survey, the restaurateur aims to embark on their entrepreneurial journey with a clear vision and a strategic roadmap for success in the competitive world of gastronomy.
This is a data frame with 500 observations on 13 variables.
Data cleaning steps included joining 2 data sets, dropping some unnecessary columns, and standardizing variables’ names. The data sets have no missing values.
Understanding the population proportion of satisfied customers is crucial for making decisions about which application to integrate into the restaurant’s services. In this case, the popular food delivery application FoodX has been identified as a potential option, boasting a notable rating of 70% for both delivery services and food quality. To validate the satisfaction level of customers, we conducted to estimate the population proportion of satisfied customers using this platform.
We decided to perform the Hypothesis of Testing Proportion in order to estimate the population proportion of satisfied customers using this application. We created a new column that computes average the ratings of customers for both food quality and delivery services.
We classify customer satisfaction based on 2 levels: Unsatisfied and Satisfied on a scale from 1 to 5, to simplify the variable to deal with:
The customers’ satisfaction level can be expressed as a frequency table.
# Create a new column "Satisfaction level" to categorize the ratings into 2 types: Unsatisfied (scores from 1 to 2.5) and Satisfied (scores from 3 to 5)
rating$s_level <- cut(rating$avr_rating,
breaks = c(0, 2.5, 5.0),
labels= c("Unsatisfied", "Satisfied"),
include.lowest = TRUE)
# Create a frequency table
s_freq <- count(rating, s_level)
# Display the table
s_freq %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| s_level | n |
|---|---|
| Unsatisfied | 162 |
| Satisfied | 338 |
To illustrate the table, we decided to use pie chart.
# Preparing data for a pie chart
s_freq <- s_freq %>%
mutate("percentage" = round(n/sum(n)*100, 1))
# Pie chart
ggplot(data= s_freq, mapping= aes(x='', y= n, fill=s_level)) +
geom_bar(stat= 'identity', width= 1, color= 'white') +
coord_polar('y') +
labs(fill = "Satisfaction Level") +
theme_void() +
geom_text(aes(label = paste0(percentage, "%")),
position = position_stack(vjust = 0.5),
color= 'white')Step 1: Hypotheses Formulation
In this case, we decided to use a one-sided test because our interest is specifically in determining if the satisfaction rate is less than 70%.
Step 2: Frequency Table and Significance level
Step 3: Conduct Hypothesis of Testing Proportion
The one-sample proportions test is conducted to assess whether the actual proportion of satisfied customers deviates significantly from the claimed 70%, providing essential insights for deciding on the adoption of the FoodX application in the restaurant.
# One-sample test of Proportions
successes <- count(rating, s_level)$n[2]
total_trials <- length(rating$s_level)
STest <- prop.test(x = successes, n = total_trials, p=0.70, alternative = "less", conf.level = 0.99)
print(STest)##
## 1-sample proportions test with continuity correction
##
## data: successes out of total_trials, null probability 0.7
## X-squared = 1.2595, df = 1, p-value = 0.1309
## alternative hypothesis: true p is less than 0.7
## 99 percent confidence interval:
## 0.0000000 0.7235309
## sample estimates:
## p
## 0.676
We can see that the p-value is much greater than the significance level of 0.01. Therefore, there is not enough evidence to reject the null hypothesis. The 99% confidence interval includes the null hypothesis value of 0.70, indicating that the true proportion of satisfied customers could reasonably be 70%.
While the observed proportion of satisfied customers (67.6%) fell short of the claimed 70%, the statistical evidence was not strong enough to reject the Null Hypothesis. The restaurateur decided that FoodX’s reported satisfaction rate was within a reasonable range, and with confidence in their decision, we decided to use FoodX to serve dishes to potential customers.
In the bustling world of restaurant entrepreneurship, selecting the right location is crucial for success. To help the restaurateur make an informed decision, we focus the investigation on the delivery times in various zones, recognizing the impact of timely deliveries on customer satisfaction.
The primary goal is to assess and compare delivery times across different zones to identify the most suitable location for the new restaurant. To achieve this, a statistical analysis is conducted using the R programming language. The analysis includes an analysis of variance (ANOVA) to determine if there are significant differences in delivery times among the zones.
First, we craft a box plot, a visual representation of the distribution of delivery times across different zones:
# Reorder Zone in ascending order based on the median value of Delivery Time
bymedian <- with(data, reorder(Zone, Delivery_Time, median))
# Create a box plot
ggplot(data, aes(x = bymedian, y = Delivery_Time, fill = Zone)) +
geom_boxplot() +
labs(title = "Delivery Times by Zone",
x = "Zone",
y = "Delivery Time") +
theme_minimal()quantile and
median functions in the dplyr package. This
step aimed to provide a detailed understanding of the central tendency
and variability within each zone.# Calculate Q1, median, and Q3 for each zone
summary_stats <- data %>%
group_by(Zone) %>%
summarize(Q1 = quantile(Delivery_Time, 0.25),
Median = median(Delivery_Time),
Q3 = quantile(Delivery_Time, 0.75))
# For removing NA’s in the table
options(knitr.kable.NA = "")
# Print the calculated statistics
summary_stats %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| Zone | Q1 | Median | Q3 |
|---|---|---|---|
| Zone A | 20.00 | 31 | 41.00 |
| Zone B | 22.00 | 28 | 40.00 |
| Zone C | 21.25 | 31 | 40.75 |
| Zone D | 20.00 | 30 | 42.00 |
The box plot visually depicts the distribution of delivery times across four distinct zones.
The box plot provides a succinct visualization of the variability and central tendencies within each zone, aiding in a quick comparison of the distribution patterns of delivery times.
Our analysis kicks off with ANOVA, a statistical method for comparing means among different groups. In our case, we model delivery times as a function of the zone:
# Perform ANOVA analysis
anova_result <- aov(Delivery_Time ~ Zone, data = data)
# Tidy ANOVA results
tidy_anova <- tidy(anova_result)
# For removing NA’s in the table
options(knitr.kable.NA = "")
# Print the ANOVA table
tidy_anova %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| term | df | sumsq | meansq | statistic | p.value |
|---|---|---|---|---|---|
| Zone | 3 | 49.32596 | 16.44199 | 0.1158169 | 0.9508255 |
| Residuals | 496 | 70414.79204 | 141.96531 |
P-value Examination
Evaluating the p-value from the ANOVA analysis (p-value = 0.9508255) provides insights into overall group differences in delivery times among different zones.
# Interpret the results based on the p-value
if (p_value < 0.05) {
interpretation <- "There is a significant difference in delivery times among the zones."
} else {
interpretation <- "There is no significant difference in delivery times among the zones."
}
interpretation## [1] "There is no significant difference in delivery times among the zones."
This interpretation, based on a significance level of 0.05, guides restaurant owners in making informed decisions regarding the optimization of delivery services.
Our meticulous analysis of delivery times across zones has yielded valuable insights for selecting an optimal location for a new restaurant. Zones A and C stand out as favorable choices due to their consistent central tendencies and moderate variability, aligning well with the goal of providing reliable and timely deliveries. Zone B, with stable delivery times, remains a viable option, while Zone D, with wider variability, requires careful consideration.
The combined use of ANOVA and visualizations, such as the box plot, provides a nuanced understanding of differences in mean delivery times. The interpretation of the p-value underscores the statistical significance, guiding a well-informed decision.
In conclusion, the integrated analysis of quartile statistics and strategic considerations reveals that Zones A and C stand out as the most suitable areas for opening the restaurant. These zones offer a compelling combination of reliability and moderate variability, aligning seamlessly with the overarching objectives of the business. The findings provide valuable insights, empowering our restaurateur with the knowledge needed for a strategic and successful commencement of the restaurant venture.
Ratings are considered one of the most important criteria of customers before booking in any given restaurant because it reflects hands-on experience of the service. This data set concerns two ratings: (1) Food and (2) Delivery Service, which will be analyzed further in this part.
Along with that, the restaurateur is also in search for a location (in Zone A, B, C or D) to run their business: whether they would receive better customer rating on delivery if the traffic is better in a specific zone, or whether customers will have a more relaxed judgment if they order food from a zone compared to others.
Instead of wondering yes or no, we set out with the Chi-square Test of Independence to answer these 2 questions:
The Chi-square Test of Independence, also known as the Chi-square Test of Association analyzes whether there is an association between categorical variables (i.e., whether they are independent or related).
We decided to perform a Chi-square Test of Independence to find out the correlation between the Restaurant Zone Locations and Customer Satisfaction for the fit of these criteria:
We deduct the level of satisfaction by categorizing the rating level of customers on the scale from 1 to 5, to simplify the variable to deal with:
The Chi-square Test of Independence examines the data using a contingency table, an arrangement of values frequency according to the categorical variables.
For this part, we compiled two contingency tables based on the different variables in each question.
# Create a contingency table for Customer Food Rating
food_rating <- data %>% mutate('Food_Satisfaction'=case_when(
Customer_Rating_Food %in% c(1, 2) ~ 'Unsatisfied',
Customer_Rating_Food %in% c(3,4, 5) ~ 'Satisfied',
TRUE ~ as.character(Customer_Rating_Food)))
food_rating <- select(food_rating, 'Food_Satisfaction', Zone)
# Display the table
table(food_rating) %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| Zone A | Zone B | Zone C | Zone D | |
|---|---|---|---|---|
| Satisfied | 45 | 93 | 64 | 151 |
| Unsatisfied | 24 | 39 | 22 | 62 |
# Mosaic plot for Customer Food Rating Across Zones
food_rating1 = table(food_rating$Food_Satisfaction, data$Zone)
food_rating1 <- t(food_rating1)
mosaicplot(
food_rating1,
color = c("#3D4578", "#F6A8A8"),
xlab = "Zone",
ylab = "Customer Food Satisfaction",
main = "Customer Food Rating")# Create a contingency table for Customer Food Rating
delivery_rating <- data %>%
mutate(Delivery_Satisfaction = case_when(
Customer_Rating_Delivery %in% c(1, 2) ~ 'Unsatisfied',
Customer_Rating_Delivery %in% c(3, 4, 5) ~ 'Satisfied',
TRUE ~ as.character(Customer_Rating_Delivery)))
delivery_rating <- select(delivery_rating, 'Delivery_Satisfaction', Zone)
# Display the table
table(delivery_rating) %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| Zone A | Zone B | Zone C | Zone D | |
|---|---|---|---|---|
| Satisfied | 37 | 79 | 56 | 132 |
| Unsatisfied | 32 | 53 | 30 | 81 |
# Mosaic Plot for Delivery Service Rating Across Zones
delivery_rating1 = table(delivery_rating$Delivery_Satisfaction, data$Zone)
delivery_rating1 <- t(delivery_rating1)
mosaicplot(
delivery_rating1,
color = c("#3D4578", "#F6A8A8"),
xlab = "Zone",
ylab = "Customer Delivery Satisfaction",
main = "Customer Delivery Rating")Step 1: Hypotheses Formulation
We formulate the hypotheses relating to our question in this part, which are the same for both questions related to Food and Delivery Service:
Step 2: Contingency Table and Significance Level
Step 3: Conduct Hypothesis Test
We then conduct the Chi-square test to assess the independence between zones and customer satisfaction.
##
## Pearson's Chi-squared test
##
## data: table(food_rating)
## X-squared = 1.5774, df = 3, p-value = 0.6645
We see that the p-value is larger than our chosen significance level. Thus, we accept the null hypothesis.
##
## Pearson's Chi-squared test
##
## data: table(delivery_rating)
## X-squared = 2.3363, df = 3, p-value = 0.5056
We see that the p-value is larger than our chosen significance level. Thus, we accept the null hypothesis.
Step 4: Interpretation
From the results of Chi-square Test of Independence and visualized plots, we find that there is no significant evidence to suggest that restaurant zones can impact Customer Rating on Food and Delivery Service.
Therefore, this F&B entrepreneur may not need to worry that the location of their restaurant will affect Customer Satisfaction with the Food and Delivery Services.
The most important factors to consider before opening a restaurant with online delivery is probably what type of food we should serve. The taste of people varies, and the restaurateur is having difficulty in determining the menu to offer, to have the best customer enjoyment and turnover rate.
Therefore, for this wonder, the Chi-square Test of Independence is utilized again to answer “How much does choice of cuisine impact customer reception on Food?”
In this Chi-square Test of Independence, we like to examine the correlation between the Cuisine and Customer Reception for the fit of these criteria:
The two working variables (Cuisine and Customer Reception) are two categorical variables.
There are two or more categories for each variable:
There is no relationship between the subjects in each group, and they are not linked in any way such as pre or post-test observations.
The sample size is relatively large with expected frequencies per cell are all larger than 1, and at least 5 for the majority of the cells.
In this part, since we wanted a more precise analysis of how well does the customer receive the food order, the 3 levels of reception is deducted by categorizing customer ratings of Food quality:
The Chi-square Test of Independence examines the data using a contingency table, an arrangement of values frequency according to the categorical variables. For this question, we conduct a Contingency Table with the variables of Customer Reception and Cuisine.
# Create a contingency table for Cuisine Food Reception
cuisine_reception <- data %>%
mutate(Cuisine_Reception = case_when(
Customer_Rating_Food %in% c(1, 2) ~ 'Displeasing', Customer_Rating_Food %in% c(3) ~ 'Adequate',
Customer_Rating_Food %in% c(4, 5) ~ 'Well-received',
TRUE ~ as.character(Customer_Rating_Food) # If none of the conditions are met, keep the original value
))
cuisine_reception <- select(cuisine_reception, 'Cuisine_Reception', Cuisine)
table(cuisine_reception) %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| African | Arabian | Belgian | Chinese | Continental | French | North Indian | South Indian | |
|---|---|---|---|---|---|---|---|---|
| Adequate | 16 | 5 | 8 | 15 | 26 | 16 | 15 | 16 |
| Displeasing | 15 | 7 | 22 | 28 | 9 | 24 | 17 | 25 |
| Well-received | 30 | 13 | 26 | 38 | 20 | 31 | 49 | 29 |
We also decided to draw a stacked bar plot to visualize the association between the customer level of reception and the cuisine that the restaurants decided to serve.
# Count occurrences of each combination
reception_counts <- count(cuisine_reception, Cuisine, Cuisine_Reception)
# Create a stacked bar chart with different colors for each category
ggplot(reception_counts, aes(x = Cuisine, y = n, fill = Cuisine_Reception)) +
geom_bar(stat = 'identity') +
labs(title = 'Customer Reception on Cuisine',
x = 'Cuisine',
y = 'Count',
fill = "Customer Reception") +
scale_fill_manual(values = c("#3D4578", "#B8D8E1", "#F6A8A8")) +
theme_test() +
theme(axis.text.x = element_text(angle = 345, face = "bold"))Step 1: Hypotheses Formulation
We formulate the hypotheses relating to our research question, including:
Step 2: Contingency Table and Significance Level
Step 3: Conduct Hypothesis Test
We then conduct the Chi-square test to assess the independence between cuisine and customer reception on food.
##
## Pearson's Chi-squared test
##
## data: table(cuisine_reception)
## X-squared = 32.302, df = 14, p-value = 0.003629
We see that the p-value is smaller than our chosen significance level (0.0036287 < 0.01). Thus, we reject the null hypothesis and find that there is sufficient evidence to suggest an association between the choice of cuisine and customer reception on food.
Step 4: Further Analysis
From the results of the Chi-square Test of Independence, we decided to conduct further analysis by calculating the observed and expected values of the variables to see which cells contribute the most to the Chi-square statistic.
# Further analysis
## Extract observed and expected values
observed_values <- results$observed
expected_values <- results$expected
## Compare observed and expected values in each cell
comparison <- data.frame(
Cuisine_Rating = rownames(observed_values),
Cuisine = colnames(observed_values),
Observed = as.vector(observed_values),
Expected = as.vector(expected_values),
Difference = as.vector(observed_values - expected_values))
## Print the comparison
comparison <- comparison %>% arrange(Cuisine_Rating)
comparison %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| Cuisine_Rating | Cuisine | Observed | Expected | Difference |
|---|---|---|---|---|
| Adequate | African | 16 | 14.274 | 1.726 |
| Adequate | Chinese | 5 | 5.850 | -0.850 |
| Adequate | North Indian | 8 | 13.104 | -5.104 |
| Adequate | Arabian | 15 | 18.954 | -3.954 |
| Adequate | Continental | 26 | 12.870 | 13.130 |
| Adequate | South Indian | 16 | 16.614 | -0.614 |
| Adequate | Belgian | 15 | 18.954 | -3.954 |
| Adequate | French | 16 | 16.380 | -0.380 |
| Displeasing | Arabian | 15 | 17.934 | -2.934 |
| Displeasing | Continental | 7 | 7.350 | -0.350 |
| Displeasing | South Indian | 22 | 16.464 | 5.536 |
| Displeasing | Belgian | 28 | 23.814 | 4.186 |
| Displeasing | French | 9 | 16.170 | -7.170 |
| Displeasing | African | 24 | 20.874 | 3.126 |
| Displeasing | Chinese | 17 | 23.814 | -6.814 |
| Displeasing | North Indian | 25 | 20.580 | 4.420 |
| Well-received | Belgian | 30 | 28.792 | 1.208 |
| Well-received | French | 13 | 11.800 | 1.200 |
| Well-received | African | 26 | 26.432 | -0.432 |
| Well-received | Chinese | 38 | 38.232 | -0.232 |
| Well-received | North Indian | 20 | 25.960 | -5.960 |
| Well-received | Arabian | 31 | 33.512 | -2.512 |
| Well-received | Continental | 49 | 38.232 | 10.768 |
| Well-received | South Indian | 29 | 33.040 | -4.040 |
The most interesting patterns we can deduct from the table of differences between the observed and expected values are:
Following the Chi-square Test of Independence and the visualized stacked bar chart, we came to the conclusion that there is a significant association between the Choice of cuisine and Customer’s Reception Level upon it.
Although the restaurant’s menu can go beyond recorded data, depending also on the restaurant’s marketing, food quality, and cooks’ talents, the restaurateur could utilize the calculated outcomes based on further analysis.
According to that, upon choosing a cuisine to focus on, this F&B entrepreneur should consider these factors:
The restaurants are categorized into 2 classes: Pro and Ordinary. Restaurateur does not know in which class they should operate their business. Thus, to help them, we are interested in comparing the order amount and the delivery time of the 2 ranks to see if there are any valuable insights.
# Narrow down the data set to work with
order_t <- data %>%
select(Category, Order_Amount)
# Box plot
ggplot(order_t, aes(x = Category, y = Order_Amount, fill= Category)) +
geom_boxplot() +
labs(title = "Boxplot of Order Amount by Category",
x = "Category",
y = "Order Amount") +
theme_minimal()
The Quartile Statistics
# Calculate min, Q1, average, median, Q3, and max for each category
order_t_summary <- order_t %>%
group_by(Category) %>%
summarise(Min = min(Order_Amount),
Q1 = quantile(Order_Amount, 0.25),
Average_Amount = mean(Order_Amount),
Median = median(Order_Amount),
Q3 = quantile(Order_Amount, 0.75),
Max = max(Order_Amount))
# Display the summary
order_t_summary %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| Category | Min | Q1 | Average_Amount | Median | Q3 | Max |
|---|---|---|---|---|---|---|
| Ordinary | 6 | 377.0 | 592.8910 | 603 | 837.0 | 1198 |
| Pro | 3 | 404.5 | 607.5587 | 633 | 814.5 | 1193 |
# Difference in average order amount between the two categories
difference_in_mean <- abs(diff(order_t_summary$Average_Amount))From the above table, we can calculate the difference in average order amount between the two categories, which is 14.6676935 dollars.
We now want to test whether there is a significant difference between the average order amounts of Ordinary and Pro restaurants through Welch’s t-test.
# Welch's t-test for differences in Order Amounts across Pro and Ordinary restaurants
t_test_result <- t.test(mu = 0, conf.level=0.99, Order_Amount ~ Category, data = order_t)
print(t_test_result)##
## Welch Two Sample t-test
##
## data: Order_Amount by Category
## t = -0.53894, df = 387.3, p-value = 0.5902
## alternative hypothesis: true difference in means between group Ordinary and group Pro is not equal to 0
## 99 percent confidence interval:
## -85.11787 55.78249
## sample estimates:
## mean in group Ordinary mean in group Pro
## 592.8910 607.5587
Based on what we received from a Welch’s t-test, it is plausible for the total bill amount to be equal for the Pro and Ordinary rank restaurants because:
So far, the testing hasn’t given us any insights. let’s take the number of orders of each restaurant class into account.
# Further analysis: The sample size of each Category
occur <- order_t %>%
group_by(Category) %>%
count(Category)
# Display
occur %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| Category | n |
|---|---|
| Ordinary | 321 |
| Pro | 179 |
We can see that Ordinary restaurants receive almost 2 times as many orders as Pro restaurants receive in a day. A possible explanation for this is that people prefer to eat in person at Pro restaurants to experience more professional and quality customer service. Note that our restaurateur does not have enough capital to operate such a high-end restaurant. Thus we can conclude that the entrepreneur should open an Ordinary restaurant to reach more potential customers through a delivery app.
How about the delivery time of the two restaurant classes?
# Narrow down the data set to work with
deli_t <- data %>%
select(Category, Delivery_Time)
# Boxplot
ggplot(deli_t, aes(x = Category, y = Delivery_Time, fill= Category)) +
geom_boxplot() +
labs(title = "Boxplot of Delivery Time by Category",
x = "Category",
y = "Delivery Time") +
theme_minimal()
The Quartile Statistics
# Calculate min, Q1, average, median, Q3, and max for each category
deli_t_summary <- deli_t %>%
group_by(Category) %>%
summarise(Min = min(Delivery_Time),
Q1 = quantile(Delivery_Time, 0.25),
Average_Deli = mean(Delivery_Time),
Median = median(Delivery_Time),
Q3 = quantile(Delivery_Time, 0.75),
Max = max(Delivery_Time))
# Display the summary
deli_t_summary %>%
kable("html") %>%
kable_styling(
bootstrap_options = c("striped", "hover"),
position = "center",
font_size = 12,
latex_options = c("scale_down")) %>%
row_spec(0, bold = TRUE, color = "white", background = "#2A3F54")| Category | Min | Q1 | Average_Deli | Median | Q3 | Max |
|---|---|---|---|---|---|---|
| Ordinary | 10 | 21.0 | 30.82866 | 30 | 41 | 50 |
| Pro | 10 | 20.5 | 30.02793 | 29 | 40 | 50 |
# Difference in average order amount between the two categories
difference_in_deli <- abs(diff(deli_t_summary$Average_Deli))From the above table, we know that the difference in average delivery time between the two ranks is 0.8007275 minutes.
Is this number significantly different? Or does it affect our decision? Let again use the Welch’s t-test to find out.
# Conduct a Welch's t-test for differences in Delivery Times across Ordinary and Pro restaurants
t_test_result <- t.test(mu= 0, conf.level=0.99, Delivery_Time ~ Category, data = deli_t)
# Print the t-test result
print(t_test_result)##
## Welch Two Sample t-test
##
## data: Delivery_Time by Category
## t = 0.72263, df = 369.13, p-value = 0.4704
## alternative hypothesis: true difference in means between group Ordinary and group Pro is not equal to 0
## 99 percent confidence interval:
## -2.068323 3.669778
## sample estimates:
## mean in group Ordinary mean in group Pro
## 30.82866 30.02793
Based on what we received from a Welch’s t-test, we do not have sufficient evidence to reject the null hypothesis because:
Conclusion: There is no significant difference in delivery time between Pro and Ordinary restaurants.
When considering the rank of the restaurant in terms of bill amount and delivery time, the restaurateur can start in any restaurant class since there is no significant difference between them. However, an Ordinary restaurant is the most suitable choice as a restaurant that takes orders through a delivery app.
Ensuring productivity and service quality is essential to developing a restaurant. To accomplish this goal, the restaurateur must understand how operational factors affect each other. In the following case, we want to see whether the delivery time and the order amount have any relation.
The main purpose is to see how the total order amount impacts the delivery time by implementing an analysis in RStudio. This consists of drawing a scatter plot and calculating the Pearson correlation coefficient to measure the strength of the association between these factors.
We use a scatter plot to visualize the relationship of the total order amount and the delivery time.
# Scatter plot
ggplot(data,
mapping = aes(x = Delivery_Time,
y = Order_Amount,
color = Delivery_Time)) +
geom_point() +
labs(x = "Delivery Time Taken (minutes)",
y = "Order Amount (dollars)",
color = "Delivery Time (minutes)")
We can see that the correlation coefficient between these two variables
is small and approximately 0, according to the plot.
Nevertheless, we need to test whether the above assumption is valid.
##
## Pearson's product-moment correlation
##
## data: data$Delivery_Time and data$Order_Amount
## t = -0.04973, df = 498, p-value = 0.9604
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.08990147 0.08547884
## sample estimates:
## cor
## -0.002228449
Based on the result, the correlation (-0.0022284) is negative and approximately equal to 0. We can conclude that there is little or no linear relationship between the two variables being considered. This could mean that the variables are unrelated or that any existing relationship is not linear.
The delivery time and order amount are not substantially influenced or have very little influence on each other. In other words, the restaurateur does not need to worry about the impact of the order amount on their delivery time.
In conclusion, our comprehensive analysis of the data set encompassing 500 orders on the FoodX delivery app provides valuable insights for the aspiring restaurateur. The decision to utilize FoodX as the preferred delivery service for the restaurant is supported by a high customer satisfaction rate of nearly 70%. This endorsement not only ensures the reliability of the delivery service but also signifies a positive customer experience, a crucial factor for a successful food business.
In terms of selecting the restaurant’s location, our analysis suggests that Zones A and C emerge as the most favorable areas, considering their optimal delivery times. This information aids in strategic decision-making regarding the establishment of the restaurant, aligning with the goal of providing timely and efficient food delivery services to customers.
Furthermore, the concern about the impact of location on customer satisfaction with food and delivery services is alleviated by our findings. It appears that customers do not significantly associate the restaurant’s location with their satisfaction levels, allowing the restaurateur greater flexibility in choosing the establishment site.
For the selection of cuisine, our analysis recommends Continental cuisine as a safe and popular option due to its familiarity with local tastes. Alternatively, French cuisine presents a promising choice with a low displeasing level of reception, offering an opportunity to diversify without sacrificing customer satisfaction. However, caution is advised against North and South Indian cuisines, as our data suggests they may not resonate as well with the local customer base.
In determining the restaurant class, an Ordinary-class establishment is identified as the most suitable choice for receiving orders through a delivery app. This aligns with the preferences and expectations of FoodX customers, ensuring a seamless integration with the delivery platform.
Finally, the restaurateur can take comfort in the fact that the order amount does not significantly impact delivery times. This insight allows for a more streamlined and efficient operational strategy, prioritizing customer satisfaction without compromising on order volume.
Armed with these informed decisions, the aspiring restaurateur can embark on the journey of opening a successful restaurant, confident in the choices made based on our meticulous data analysis.