This report examines whether perceived switching hassle (“It would be
a hassle to switch to a different provider”) is associated with
commitment to a current phone/internet provider (“I feel committed to
staying with my current provider”). I first fit a simple linear
regression, then add satisfaction with technical support and perceived
price fairness to see whether the relationship changes. Commitment is a
core component of customer loyalty (Oliver, 1999), and perceived
switching barriers are a common explanation for why customers stay with
a provider (Jones & Sasser, 1995). The report follows the workflow
in the assigned tutorial (Xu, n.d.), and the regression formula follows
R’s lm() documentation (R Core Team, n.d.).
The outcome, provider_commitment, and all three
predictors are 5-point agreement ratings (1 = Strongly Disagree, 5 =
Strongly Agree). The models treat these codes as numeric, so each
coefficient describes the change in the commitment rating for a
one-point change in the predictor.
The Qualtrics export contains two extra rows below the column headers: the question-label row and the ImportId row. I removed those rows, kept completed non-preview responses, converted the answer choices to numeric codes, renamed the Qualtrics question columns to descriptive names, and saved the result as a separate analysis file. Missing values in the four regression variables would be replaced by their column means. (Edit this paragraph so it matches exactly what you did in your own cleaning steps.)
clean <- read.csv(
"customer_loyalty_cleaned.csv",
stringsAsFactors = FALSE,
na.strings = c("", "NA"),
fileEncoding = "UTF-8"
)
# Mean-impute any missing values in the four regression variables.
rating_columns <- c(
"price_fairness", "tech_satisfaction",
"switching_hassle", "provider_commitment"
)
for (col in rating_columns) {
col_mean <- round(mean(clean[[col]], na.rm = TRUE), 2)
clean[[col]][is.na(clean[[col]])] <- col_mean
}
write.csv(clean, "customer_loyalty_cleaned_final.csv", row.names = FALSE, na = "")
cat("Rows retained for the clean dataset:", nrow(clean), "\n")
## Rows retained for the clean dataset: 11
missing_by_column <- data.frame(
Variable = names(clean),
Missing = as.integer(colSums(is.na(clean)))
)
knitr::kable(missing_by_column, caption = "Missing values in the cleaned data")
| Variable | Missing |
|---|---|
| respondent_id | 0 |
| age_group | 0 |
| contract_type | 0 |
| customer_tenure | 0 |
| addon_tech_support | 1 |
| addon_online_security | 1 |
| addon_device_protection | 1 |
| addon_online_backup | 1 |
| addon_streaming_tv_movies | 1 |
| switch_likelihood | 0 |
| plan_preference | 0 |
| price_fairness | 0 |
| tech_satisfaction | 0 |
| switching_hassle | 0 |
| provider_commitment | 0 |
age_counts <- as.data.frame(table(clean$age_group))
names(age_counts) <- c("Age group", "Number of respondents")
knitr::kable(age_counts, caption = "Respondents by age group")
| Age group | Number of respondents |
|---|---|
| 18-24 | 9 |
| 25-35 | 1 |
| 35-44 | 1 |
commitment_counts <- as.data.frame(table(clean$provider_commitment))
names(commitment_counts) <- c("Commitment rating", "Number of respondents")
knitr::kable(commitment_counts, caption = "Respondents by provider-commitment rating")
| Commitment rating | Number of respondents |
|---|---|
| 2 | 3 |
| 3 | 4 |
| 4 | 3 |
| 5 | 1 |
The clean file contains 11 respondents. The four rating columns used in the regressions have no missing values, so no mean replacement was needed for them. The add-on service columns (not used in the models) contain one missing respondent. Most respondents (9 of 11) are in the 18-24 age group, so the results should not be generalized to other ages.
The simple model predicts provider_commitment from
switching_hassle alone.
simple_model <- lm(provider_commitment ~ switching_hassle, data = clean)
summary(simple_model)
##
## Call:
## lm(formula = provider_commitment ~ switching_hassle, data = clean)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.3768 -0.5725 0.1594 0.6232 1.0870
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.2319 0.8758 1.407 0.1931
## switching_hassle 0.5362 0.2311 2.321 0.0454 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8185 on 9 degrees of freedom
## Multiple R-squared: 0.3744, Adjusted R-squared: 0.3048
## F-statistic: 5.385 on 1 and 9 DF, p-value: 0.04544
plot(
x = jitter(clean$switching_hassle, amount = 0.08),
y = jitter(clean$provider_commitment, amount = 0.08),
pch = 19,
col = "#2166AC",
xlab = "Agreement that switching would be a hassle (1-5)",
ylab = "Commitment to current provider (1-5)",
main = "Switching hassle and provider commitment"
)
abline(simple_model, col = "#B2182B", lwd = 2)
grid(col = "gray85")
The plot shows a positive relationship: respondents who agree more strongly that switching would be a hassle also report greater commitment to their provider. Because both variables have only a few response values, points are slightly jittered so overlapping respondents are visible; the fitted line uses the original values.
The multivariate model adds satisfaction with technical support and perceived price fairness while keeping the same outcome.
multivariate_model <- lm(
provider_commitment ~ switching_hassle + tech_satisfaction + price_fairness,
data = clean
)
summary(multivariate_model)
##
## Call:
## lm(formula = provider_commitment ~ switching_hassle + tech_satisfaction +
## price_fairness, data = clean)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.9704 -0.2796 0.1931 0.3337 0.9145
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.7139 1.1418 -0.625 0.5516
## switching_hassle 0.4448 0.2151 2.068 0.0774 .
## tech_satisfaction 0.4475 0.2895 1.546 0.1660
## price_fairness 0.2813 0.1930 1.457 0.1884
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7036 on 7 degrees of freedom
## Multiple R-squared: 0.6404, Adjusted R-squared: 0.4863
## F-statistic: 4.156 on 3 and 7 DF, p-value: 0.05503
coefficient_table <- function(model) {
model_summary <- coef(summary(model))
data.frame(
Term = rownames(model_summary),
Estimate = model_summary[, "Estimate"],
Std_Error = model_summary[, "Std. Error"],
t_value = model_summary[, "t value"],
p_value = model_summary[, "Pr(>|t|)"],
row.names = NULL
)
}
knitr::kable(
coefficient_table(simple_model),
digits = 4,
caption = "Simple-model coefficients"
)
| Term | Estimate | Std_Error | t_value | p_value |
|---|---|---|---|---|
| (Intercept) | 1.2319 | 0.8758 | 1.4066 | 0.1931 |
| switching_hassle | 0.5362 | 0.2311 | 2.3206 | 0.0454 |
knitr::kable(
coefficient_table(multivariate_model),
digits = 4,
caption = "Multivariate-model coefficients"
)
| Term | Estimate | Std_Error | t_value | p_value |
|---|---|---|---|---|
| (Intercept) | -0.7139 | 1.1418 | -0.6253 | 0.5516 |
| switching_hassle | 0.4448 | 0.2151 | 2.0681 | 0.0774 |
| tech_satisfaction | 0.4475 | 0.2895 | 1.5460 | 0.1660 |
| price_fairness | 0.2813 | 0.1930 | 1.4574 | 0.1884 |
model_comparison <- data.frame(
Model = c("Simple", "Multivariate"),
N = c(nobs(simple_model), nobs(multivariate_model)),
R_squared = c(summary(simple_model)$r.squared, summary(multivariate_model)$r.squared),
Adjusted_R_squared = c(
summary(simple_model)$adj.r.squared,
summary(multivariate_model)$adj.r.squared
)
)
knitr::kable(model_comparison, digits = 3, caption = "Fit statistics")
| Model | N | R_squared | Adjusted_R_squared |
|---|---|---|---|
| Simple | 11 | 0.374 | 0.305 |
| Multivariate | 11 | 0.640 | 0.486 |
coded_correlation <- cor(clean$switching_hassle, clean$provider_commitment)
cat("Pearson correlation between switching hassle and commitment:",
round(coded_correlation, 3), "\n\n")
## Pearson correlation between switching hassle and commitment: 0.612
# Standardized coefficients show which predictor matters most.
z <- as.data.frame(scale(clean[, rating_columns]))
standardized_model <- lm(
provider_commitment ~ switching_hassle + tech_satisfaction + price_fairness,
data = z
)
knitr::kable(
coefficient_table(standardized_model)[-1, c("Term", "Estimate", "p_value")],
digits = 3,
caption = "Standardized coefficients (larger absolute value = stronger predictor)"
)
| Term | Estimate | p_value | |
|---|---|---|---|
| 2 | switching_hassle | 0.508 | 0.077 |
| 3 | tech_satisfaction | 0.379 | 0.166 |
| 4 | price_fairness | 0.335 | 0.188 |
# Does adding the two predictors improve the model significantly?
anova(simple_model, multivariate_model)
## Analysis of Variance Table
##
## Model 1: provider_commitment ~ switching_hassle
## Model 2: provider_commitment ~ switching_hassle + tech_satisfaction +
## price_fairness
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 9 6.0290
## 2 7 3.4649 2 2.564 2.59 0.1439
Switching hassle is the strongest predictor of commitment in both models. In the multivariate model its coefficient is smaller than in the simple model, and none of the three predictors is statistically significant at the .05 level. R-squared and adjusted R-squared both increase after adding predictors, so the extra variables improve explanatory value, but the nested-model test (above) does not show a statistically significant improvement. With only 11 respondents the estimates are imprecise, and this small observational survey does not establish cause and effect.
In the simple model, switching hassle was positively associated with provider commitment (b = 0.536, p = .045, R² = .374). After adding tech support satisfaction and price fairness, the hassle coefficient fell to 0.445 (p = .077), and neither added predictor was significant, although R² rose to .640 and adjusted R² rose from .305 to .486. Switching hassle mattered most (standardized β = .51, versus .38 for tech support and .34 for price fairness). The scatterplot shows a moderate-to-strong positive relationship (r = .612): customers who say switching would be a hassle report more commitment. The coefficient shrank because predictors overlap (hassle and tech satisfaction correlate at .36). With only 11 respondents, mostly aged 18-24, estimates are imprecise and associational, not causal. I would collect a larger, more age-balanced sample and use a validated multi-item loyalty scale.
Jones, T. O., & Sasser, W. E. (1995). Why satisfied customers defect. Harvard Business Review, 73(6), 88-99.
Oliver, R. L. (1999). Whence consumer loyalty? Journal of Marketing, 63(4_suppl1), 33-44.
R Core Team. (n.d.). lm: Fitting linear models. R Documentation. https://stat.ethz.ch/R-manual/R-devel/library/stats/html/lm.html
Xu, Z. (n.d.). Discussion 12 R regression tutorial [Video]. YouTube. https://www.youtube.com/watch?v=5NI7V4NQghg