Rank-Based Comparison of Customer Experience Ratings Across Four Retail Locations
← Chapter 175
Capstone 16 · Technical Report
Technical Report

Rank-Based Comparison of Customer Experience Ratings Across Four Retail Locations

Kruskal-Wallis with Dunn's post-hoc procedure under Holm correction, and the non-transitivity of pairwise significance.

Author  John Fisher
Series  Statistics, Data Science and AI: A Visual Handbook
Design  Cross-sectional observational, ordinal outcome, four independent groups, α = 0.05
Where this comes from
Chapter Chapter 175 · Kruskal-Wallis: Ratings Across Four Stores
Part Part XXVII · Capstone Projects: Statistical Testing
Dataset capstone-store-ratings-across-locations.xlsx
Notebook View the analysis
Abstract. Objective. To determine whether customer experience ratings differ across four retail locations, and to identify which locations can be distinguished. Methods. Ratings were collected on a 1-to-10 ordinal scale over one quarter. After cleaning, n = 194 ratings were analyzed across four unequally sized groups (43 to 57). ANOVA assumptions were assessed by Shapiro-Wilk and Levene tests. The Kruskal-Wallis test was specified as the omnibus procedure with ε² as the effect size; Dunn's test with Holm correction provided the pairwise follow-up. Results. Normality was rejected in three of four groups and homogeneity of variance was rejected overall (Levene p = 0.0012; SD ratio 1.68). The omnibus test was significant, H = 32.751, df = 3, p = 3.64e-07, ε² = 0.157. Mean ranks ordered Riverside (126.8) > Old Town (110.0) > Northgate (88.8) > Harbour Point (63.8). Of six pairwise comparisons, three reached significance after correction; the three adjacent-pair comparisons did not. Two groups sharing a median of 7 were separated by 21 mean-rank points. Conclusions. Experience varies materially by location, with Harbour Point the lowest-rated and most variable. The pairwise structure is not a total order: a middle group overlaps two groups that are themselves distinguishable, and reporting the locations as ranked tiers would misstate the evidence.

Keywords: Kruskal-Wallis; Dunn's test; Holm correction; epsilon-squared; ordinal outcomes; stochastic dominance; non-transitivity of significance; unequal group sizes.

1. Introduction

Comparison of an ordinal outcome across several independent groups is a routine problem with two routine errors. The first is applying one-way ANOVA to a bounded rating scale on the grounds that the sample is large; this conflates robustness of the sampling distribution with meaningfulness of the estimand, since the arithmetic mean of an ordinal variable presupposes interval spacing the instrument does not supply. The second is reading the omnibus result as if it licensed statements about particular groups.

The present analysis addresses both. Kruskal-Wallis is used as the omnibus procedure, and Dunn's test under Holm correction provides the pairwise comparisons. The resulting pattern is instructive in its own right: pairwise significance does not induce a total order over the groups, a point of interpretation that is frequently mishandled in applied reporting.

The hypotheses are H₀: the four location rating distributions are identical, against H₁: at least one differs stochastically, evaluated at α = 0.05.

2. Data

Table 1. Data-cleaning provenance. One record carried a rating of 11.
StepRuleResult
Raw export201 rows
De-duplicationdrop duplicate records198 rows
Missing valuesdrop rows missing the rating195 rows
Range validationretain ratings 1–10194 rows
Label normalizationcase-fold location labels4 groups
Table 2. Descriptive statistics by location. Group sizes reflect collection effort rather than store volume.
LocationnMedianIQRMeanSDRated 8+
Riverside4687–97.961.3363%
Old Town4877–87.421.3748%
Northgate5776–86.791.7433%
Harbour Point4364–75.632.2423%
Boxplots with jittered observations and stacked composition bars for four stores.
Figure 1. Rating distributions by location (left) and the same data as response composition (right).

Two features of the descriptive picture matter for what follows. Harbour Point is not only lowest but substantially more dispersed, with a standard deviation 68% larger than the tightest group; dispersion is a substantive finding here, indicating variability of experience rather than a uniform deficit. Second, Old Town and Northgate share a median of 7 while differing markedly in their upper tails, a configuration that will demonstrate the limits of median-based reasoning in Section 5.

3. Methods

Table 3. Assumption diagnostics for one-way ANOVA.
AssumptionTestResultVerdict
Normality, RiversideShapiro-WilkW = 0.931, p = 0.0092violated
Normality, Old TownShapiro-WilkW = 0.932, p = 0.0084violated
Normality, NorthgateShapiro-WilkW = 0.956, p = 0.0373violated
Normality, Harbour PointShapiro-WilkW = 0.971, p = 0.3302not rejected
Homogeneity of varianceLevenep = 0.0012violated
Homogeneity of varianceBartlettp = 1.11e-03violated

No individual group departs dramatically from normality, but with ratings concentrated in the upper half of a bounded scale the departures are systematic. Together with the violation of variance homogeneity and the ordinal measurement level, the parametric route is not adopted.

Kruskal-Wallis ranks all observations jointly and compares mean ranks across groups; it accommodates unequal group sizes without adjustment. Effect size is reported as ε² = (H − k + 1) / (N − k), the proportion of rank variance attributable to group membership. Dunn's test was specified in advance as the post-hoc procedure, using the pooled ranking from the omnibus test, with Holm's step-down correction across the six comparisons. Analyses used SciPy and scikit-posthocs in Python 3.

4. Results

Table 4. Omnibus test.
StatisticValue
Kruskal-Wallis H32.751
df3
p-value3.64e-07
Epsilon-squared0.157
N194

Location accounts for approximately 16% of the variance in ranks, a moderate effect for a factor as coarse as premises. The omnibus result licenses only the statement that at least one location differs.

A lollipop chart of mean ranks and a four by four matrix of adjusted p-values.
Figure 2. Mean rank by location (left) and Holm-adjusted Dunn p-values for all six pairwise comparisons (right).
Table 5. Pairwise comparisons, ordered by mean-rank difference.
ComparisonMean-rank differenceHolm-adjusted pVerdict
Riverside vs Harbour Point+63.0< 0.0001significant
Old Town vs Harbour Point+46.20.0004significant
Riverside vs Northgate+38.10.0021significant
Northgate vs Harbour Point+25.00.0762not distinguishable
Old Town vs Northgate+21.20.1007not distinguishable
Riverside vs Old Town+16.80.1401not distinguishable

Three of six comparisons survive correction, and they are the three largest gaps. The three that do not are precisely the adjacent-pair comparisons, whose mean-rank differences (25.0, 21.2 and 16.8) fall below the resolution the present sample provides. The Northgate-Harbour Point comparison (p = 0.0762) is marginal and would plausibly reach significance with a modest increase in sample size; it is reported as unresolved rather than as evidence of equivalence.

5. Two interpretive points

The procedure does not compare medians. Northgate and Old Town share a median of 7, yet Dunn's test separates them by 21.2 mean-rank points, driven by their upper tails (48% versus 33% rating 8 or above). Kruskal-Wallis, like the Wilcoxon-Mann-Whitney procedure of which it is the k-sample generalization, addresses stochastic ordering rather than any single location parameter. Reporting it as a test of medians is a category error that this dataset makes visible.

Pairwise significance is not transitive. Riverside differs from Northgate (p = 0.0021), while Old Town, whose mean rank lies between them, differs from neither (p = 0.1401 and p = 0.1007). This is not contradictory. Non-rejection is not an assertion of equality, and an intermediate group can overlap both neighbors at the available resolution while those neighbors are separated from each other. The practical implication is that the four locations should not be reported as ranked tiers. Presentational devices that impose a total order, including league tables and connecting-letters displays applied without care, overstate what the comparisons establish.

6. Interval estimates and confounding assessment

Table 6. Interval estimates for the pairwise shifts, the top-box proportions, and the effect size.
QuantityEstimate95% CIDunn p
Riverside vs Harbour Point+2.0+1.0 to +3.0< 0.0001
Old Town vs Harbour Point+2.0+1.0 to +3.00.0004
Riverside vs Northgate+1.0+1.0 to +2.00.0021
Northgate vs Harbour Point+1.0+0.0 to +2.00.0762
Old Town vs Northgate+1.0+0.0 to +1.00.1007
Riverside vs Old Town+1.0+0.0 to +1.00.1401
Top-box share, Riverside63%49% to 75%
Top-box share, Harbour Point23%13% to 38%
Epsilon-squared0.1570.074 to 0.283

Three pairwise comparisons were reported as non-significant, and that designation conflates two distinct evidential situations: a small difference estimated precisely, and a potentially substantial difference estimated imprecisely. The interval estimates separate them. The Northgate and Harbour Point contrast admits a difference of up to two rating points, whereas the Riverside and Old Town contrast excludes anything beyond one. The former warrants further data collection; the latter does not.

The shift estimates are constrained to integer values because the outcome is integer-valued, which limits their resolution on a ten-point scale. The top-box proportions provide finer discrimination and are additionally expressed in units meaningful to operational readers, without requiring the arithmetic mean of an ordinal variable.

Customer tenure, recorded but not previously analyzed, satisfies neither condition required of a confounder: it does not differ across locations (p = 0.55) and is not associated with the rating (p = 0.85). That eliminates one alternative explanation. Catchment composition, store size, footfall and staffing were not measured and remain open, and the comparison is observational in a way the experimental capstone in this series is not.

7. Discussion

Customer experience differs materially across the four locations. Harbour Point is the lowest-rated and the most variable, and is distinguishable from both higher-rated stores; Riverside is the highest-rated. The middle two locations are not separable from each other.

Several limitations bear on interpretation. Feedback is volunteered, so respondents are self-selected, and if propensity to respond correlates with dissatisfaction differentially across stores, some portion of the observed gap is a participation artifact rather than a service difference. The locations differ in catchment, size, and traffic patterns, none of which is measured here, so the analysis localizes variation without explaining it; in particular it provides no basis for attributing the difference to staff. Group sizes reflect collection effort, so the pooled distribution does not describe the customer base.

The dispersion finding deserves separate treatment. A location whose ratings span the full scale is producing an inconsistent experience, which has different operational causes from a uniformly poor one and is invisible to any analysis reporting only central tendency. Investigation at Harbour Point should begin with variation across shifts, days, and staff configurations rather than with the site as a whole.

Finally, and as elsewhere in this series, the arithmetic mean of an ordinal rating should not be used for reporting. The response composition, or a top-box proportion, conveys the same information without presupposing equal spacing.

8. Conclusion

Customer experience ratings differ across the four locations (Kruskal-Wallis H = 32.751, df = 3, p = 3.64e-07, ε² = 0.157, N = 194). Three of six pairwise comparisons survive Holm correction: Riverside and Old Town each exceed Harbour Point, and Riverside exceeds Northgate. The adjacent-pair comparisons remain unresolved, and the locations should not be reported as an ordered ranking. Harbour Point is the indicated priority, on both level and variability of ratings.

References

  • Kruskal, W. H., & Wallis, W. A. (1952). Use of ranks in one-criterion variance analysis. Journal of the American Statistical Association, 47(260), 583–621.
  • Dunn, O. J. (1964). Multiple comparisons using rank sums. Technometrics, 6(3), 241–252.
  • Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6(2), 65–70.
  • Tomczak, M., & Tomczak, E. (2014). The need to report effect size estimates revisited: an overview of some recommended measures of effect size. Trends in Sport Sciences, 1(21), 19–25.
  • Divine, G. W., Norton, H. J., Barón, A. E., & Juarez-Colunga, E. (2018). The Wilcoxon-Mann-Whitney procedure fails as a test of medians. The American Statistician, 72(3), 278–286.
  • Gardner, M. J., & Altman, D. G. (1986). Confidence intervals rather than P values: estimation rather than hypothesis testing. British Medical Journal, 292(6522), 746–750.
  • Hollander, M., Wolfe, D. A., & Chicken, E. (2014). Nonparametric Statistical Methods (3rd ed.). Wiley.

Reproducibility

The dataset (capstone-store-ratings-across-locations.xlsx) and an executable notebook reproducing every statistic, table, and figure accompany the chapter. Analyses use NumPy, pandas, SciPy, scikit-posthocs, and Matplotlib.

From Statistics, Data Science and AI: A Visual Handbook by John Fisher. Every statistic, table, and figure in this report is reproduced by the companion notebook.