This analysis examines simulated restaurant preference survey data. The goal is to explore factors that may be related to how much consumers spend on restaurant meals and to compare a simple regression model with a multivariate regression model.
data <- read.csv("restaurant_preferences_simulated_raw.csv")
head(data)
## ResponseID Q2_Income Q3_Frequency Q4_Spending Q5_Ratings
## 1 SIM-01 2 2 2 4
## 2 SIM-02 3 3 3 5
## 3 SIM-03 1 2 1 3
## 4 SIM-04 4 4 4 4
## 5 SIM-05 3 3 3 5
## 6 SIM-06 5 4 5 4
## DataType
## 1 SIMULATED - NOT ACTUAL SURVEY RESPONSES
## 2 SIMULATED - NOT ACTUAL SURVEY RESPONSES
## 3 SIMULATED - NOT ACTUAL SURVEY RESPONSES
## 4 SIMULATED - NOT ACTUAL SURVEY RESPONSES
## 5 SIMULATED - NOT ACTUAL SURVEY RESPONSES
## 6 SIMULATED - NOT ACTUAL SURVEY RESPONSES
str(data)
## 'data.frame': 15 obs. of 6 variables:
## $ ResponseID : chr "SIM-01" "SIM-02" "SIM-03" "SIM-04" ...
## $ Q2_Income : int 2 3 1 4 3 5 2 4 3 6 ...
## $ Q3_Frequency: int 2 3 2 4 3 4 3 5 2 5 ...
## $ Q4_Spending : int 2 3 1 4 3 5 2 4 3 5 ...
## $ Q5_Ratings : int 4 5 3 4 5 4 3 5 4 5 ...
## $ DataType : chr "SIMULATED - NOT ACTUAL SURVEY RESPONSES" "SIMULATED - NOT ACTUAL SURVEY RESPONSES" "SIMULATED - NOT ACTUAL SURVEY RESPONSES" "SIMULATED - NOT ACTUAL SURVEY RESPONSES" ...
summary(data)
## ResponseID Q2_Income Q3_Frequency Q4_Spending Q5_Ratings
## Length :15 Min. :1.0 Min. :1.000 Min. :1.000 Min. :2.0
## N.unique :15 1st Qu.:2.0 1st Qu.:2.000 1st Qu.:2.000 1st Qu.:3.5
## N.blank : 0 Median :3.0 Median :3.000 Median :3.000 Median :4.0
## Min.nchar: 6 Mean :3.2 Mean :3.267 Mean :3.133 Mean :4.0
## Max.nchar: 6 3rd Qu.:4.0 3rd Qu.:4.000 3rd Qu.:4.000 3rd Qu.:5.0
## Max. :6.0 Max. :5.000 Max. :5.000 Max. :5.0
## DataType
## Length :15
## N.unique : 1
## N.blank : 0
## Min.nchar:39
## Max.nchar:39
##
simple_model <- lm(Q4_Spending ~ Q3_Frequency, data = data)
summary(simple_model)
##
## Call:
## lm(formula = Q4_Spending ~ Q3_Frequency, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.9477 -0.3837 0.1163 0.2122 1.1802
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.07558 0.48039 0.157 0.877
## Q3_Frequency 0.93605 0.13754 6.806 1.25e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6586 on 13 degrees of freedom
## Multiple R-squared: 0.7808, Adjusted R-squared: 0.764
## F-statistic: 46.32 on 1 and 13 DF, p-value: 1.251e-05
multiple_model <- lm(Q4_Spending ~ Q3_Frequency + Q2_Income + Q5_Ratings, data = data)
summary(multiple_model)
##
## Call:
## lm(formula = Q4_Spending ~ Q3_Frequency + Q2_Income + Q5_Ratings,
## data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.64407 -0.05226 0.05085 0.13277 0.28531
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.14972 0.29486 0.508 0.622
## Q3_Frequency 0.07627 0.10683 0.714 0.490
## Q2_Income 0.84746 0.09516 8.905 2.32e-06 ***
## Q5_Ratings 0.00565 0.09064 0.062 0.951
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.242 on 11 degrees of freedom
## Multiple R-squared: 0.975, Adjusted R-squared: 0.9681
## F-statistic: 142.8 on 3 and 11 DF, p-value: 4.338e-09
plot(data$Q3_Frequency, data$Q4_Spending,
xlab = "Restaurant Purchase Frequency",
ylab = "Restaurant Spending",
main = "Restaurant Frequency and Spending")
abline(simple_model)
The regression results are used to determine which predictor has the strongest relationship with restaurant spending. The simple model examines restaurant purchase frequency by itself, while the multivariate model also considers household income and the importance consumers place on customer ratings.