Mann–Whitney U Test | Colonoscopy Time With and Without Abdominal Surgery

When 40,000 examination records are compared between 2 groups, even a very small difference gives a small P value, and the meaning of the difference can no longer be read from the test result alone. This case study uses the duration of colonoscopy. I checked whether the choice of the Mann–Whitney U test suited the aim of the study, and went on to decide how to present the size of the difference and which figure to use for presentation.

The study setting, disease, variables, and numbers in this article were newly created by me to explain how the analysis was carried out. The numbers were calculated from a randomly generated dataset and do not reflect the content or circumstances of any actual client project.

40,400 examinations, 1,460 with a history of surgery

The data were records of 40,400 colonoscopies (1 per person) performed over 4 fiscal years at 1 health checkup and endoscopy center: 1,460 in people with a history of abdominal surgery and 38,940 in people without (Table 1). The 2 measures compared were cecal intubation time and observation time.

The questions brought to me were 2: whether the Mann–Whitney U test could be used for these 2 times, and which figures and numbers to show in a presentation. In the background data, the group with a surgical history was older, with a mean age of 63.5 years as compared with 57.6 years in the group without, and the proportion of women also differed.

Table 1. Characteristics of the 2 groups according to history of abdominal surgery
Surgical history (n=1,460) No surgical history (n=38,940)
Age (years) 63.5±11.1 57.6±10.9
70 years or older 419 (28.7) 5,443 (14.0)
Female 768 (52.6) 17,176 (44.1)
Fiscal year of examination
Year 1 355 (24.3) 9,002 (23.1)
Year 2 367 (25.1) 9,612 (24.7)
Year 3 348 (23.8) 9,889 (25.4)
Year 4 390 (26.7) 10,437 (26.8)
* Values are mean±SD or no. (%). One examination is counted per person.

Choosing the Mann–Whitney U test because the interest is in a shift in location, not in the mean

Cecal intubation time in the group without a surgical history had a median of 6.4 minutes, a 99th percentile of 24.3 minutes, and a maximum of 78.3 minutes, a distribution skewed to the right. What approaches a normal distribution when the number of examinations is large is the distribution of the mean; the distribution of individual times remains skewed even with 40,000 examinations.

To check this shape, I used histograms and quantiles and did not use a normality test. With 40,000 examinations, even a slight skew is always rejected, and the test gives no basis for choosing a method.

What the study wanted to know was how much longer an ordinary examination takes, not the difference in means, which is pulled by a small number of long examinations, so the rank-based U test suited the aim. Long examinations are real examinations, so I did not exclude outliers and handled them as they were with this test, which is robust to extreme values.

The test can be used even though the group sizes differ by a factor of about 27, but the P value becomes smaller as the number of examinations grows. I therefore decided to present the size of the difference in 2 ways: the Hodges–Lehmann estimator with its 95% confidence interval, and the probability that an examination with a surgical history is longer.

Cecal intubation time was 1.6 minutes longer, and the difference in observation time was 0.3 minutes

Two-panel figure of violin plots with box plots showing the distributions of cecal intubation time and observation time in the groups without and with a surgical history
Figure 1. Distributions of the 2 times compared with the Mann–Whitney U test. Width shows the number of examinations, and the box inside shows the interquartile range and median. The vertical axis is drawn up to the 99.5th percentile of each measure.
Table 2. Summary of the 2 times in each group and the size of the difference (overall and by fiscal year)
Surgical history* No surgical history* Difference (95% CI)† Probability of being longer (%)‡ P value§
Cecal intubation time (min)
Overall 8.1 (5.3 to 12.6) 6.4 (4.4 to 9.4) 1.6 (1.3 to 1.8) 61.1 (59.5 to 62.6) <0.001
Year 1 8.2 (5.5 to 12.8) 6.6 (4.5 to 9.5) 1.7 (1.3 to 2.2) 61.6 (58.5 to 64.8) <0.001
Year 2 8.4 (5.5 to 12.8) 6.5 (4.5 to 9.5) 1.7 (1.3 to 2.1) 61.8 (58.7 to 64.9) <0.001
Year 3 8.4 (5.2 to 12.9) 6.4 (4.4 to 9.4) 1.7 (1.2 to 2.1) 61.5 (58.3 to 64.7) <0.001
Year 4 7.5 (5.1 to 11.9) 6.3 (4.3 to 9.2) 1.2 (0.9 to 1.6) 59.5 (56.5 to 62.4) <0.001
Observation time (min)
Overall 8.5 (6.6 to 10.9) 8.1 (6.4 to 10.4) 0.3 (0.2 to 0.5) 53.4 (51.8 to 54.9) <0.001
Year 1 8.1 (6.4 to 10.5) 8.0 (6.2 to 10.2) 0.2 (-0.1 to 0.5) 51.7 (48.6 to 54.8) 0.28
Year 2 8.3 (6.4 to 10.4) 8.1 (6.3 to 10.3) 0.1 (-0.2 to 0.4) 51.0 (48.0 to 54.0) 0.52
Year 3 8.7 (6.6 to 11.0) 8.2 (6.4 to 10.4) 0.4 (0.1 to 0.8) 54.2 (51.2 to 57.3) 0.007
Year 4 8.9 (7.1 to 11.6) 8.3 (6.5 to 10.6) 0.7 (0.4 to 1.0) 56.5 (53.5 to 59.4) <0.001
* Median (interquartile range).
† Hodges–Lehmann estimator (surgical history minus none, in minutes).
‡ Probability (95% confidence interval) that the examination with a surgical history is the longer one when 1 examination is drawn from each group. It is 50% when there is no difference.
§ Mann–Whitney U test.

Cecal intubation time was 1.6 minutes (95% CI, 1.3 to 1.8) longer in the group with a surgical history, and the probability that an examination with a surgical history was longer was 61.1% (Table 2). In Figure 1 as well, the bulk of the distribution in the group with a surgical history sits higher and the tail is thicker.

Observation time, in contrast, had P<0.001, but the difference was 0.3 minutes (0.2 to 0.5), which is 18 seconds, and the probability of being longer was 53.4%. Given that the interquartile range in the group without a surgical history is 4.0 minutes wide, this is a small difference relative to the variation between examinations, and whether it is clinically meaningful has to be judged separately from the P value.

Hodges–Lehmann estimates and 95% confidence intervals of the differences in cecal intubation time and observation time, shown side by side overall and for the 4 fiscal years
Figure 2. Differences (surgical history minus none) and 95% confidence intervals by fiscal year. Diamonds are the overall estimates, and squares are the individual years.

By fiscal year, the difference in cecal intubation time was 1.2 to 1.7 minutes, in the same direction in all 4 years (Figure 2). The difference in observation time, in contrast, varied by year from 0.1 to 0.7 minutes, and in years 1 and 2 the confidence interval included 0.

Taken together, the statistical conclusion is that cecal intubation time was about a minute and a half longer in examinations with a surgical history and that this difference was stable across the 4 years, whereas the difference in observation time was about 18 seconds and was not consistent across years. This was a retrospective study, and the group with a surgical history was also older, so the difference cannot be attributed to the surgical history itself.

For the presentation figure, I chose the violin plot, because a box plot does not show how thick the tail is. I advised that the report present the medians and interquartile ranges alongside the differences and 95% confidence intervals, and avoid showing P values alone.

Work performed and estimated fee

Item Details
Analysis method Comparison of 2 groups with the Mann–Whitney U test (Hodges–Lehmann estimator with 95% confidence interval, and the probability of being longer with a surgical history)
Additional analyses Analysis of the data for each of the 4 fiscal years, and 2 pieces of advice, on the choice of test and on the figure and reporting for presentation
Tables prepared 1 table of the characteristics of the 2 groups, 1 table comparing the 2 times (overall and by fiscal year); 2 tables in total
Figures prepared 1 violin plot, 1 figure of differences by fiscal year; 2 figures in total
Deliverables Analysis report (reasons for the choice of methods and discussion of the results), tables of results (Excel), figures (PNG and TIFF), and a draft of the statistical analysis section for the paper. Analysis code is available on request for an additional fee (¥22,000, incl. tax)
Estimated time About 1 week from receipt of the data
Estimated fee ¥143,000 (incl. tax)

The table lists the main analyses only. I also carry out the finer analyses needed to follow a sound statistical process, such as checking distributions and cleaning the data; these, together with after-care with no time limit (answers to your questions after delivery), are included in the fee.

Data Scientist Kenichiro Suzuki

Data ScientistKenichiro Suzuki

Free consultationSee fee examples

Recent Posts

Linear Mixed Model | 6-Minute Walk Distance in COPD Rehabilitation

A linear mixed model comparing 6-minute walk distance at four time points with missing data. How to read a non-significant group-by-time interaction.

Cox Regression and Multiple Imputation | Mortality in Hemodialysis

Cox regression of 8 factors and all-cause mortality in new hemodialysis patients, with multiple imputation for missing grip strength and other values.

ROC Analysis | Comparing the AUCs of 4 Blood Markers for Bacteremia

ROC analysis of the AUCs of 4 markers for bacteremia: all pairs tested with the paired DeLong test and corrected with the Benjamini–Hochberg procedure.

Kruskal–Wallis Test | Fatigue and Pain in 5 Rheumatoid Arthritis Groups

Kruskal–Wallis test with corrected pairwise comparisons of fatigue and pain scores among 5 rheumatoid arthritis treatment groups, plus factor analysis.

RMST | Pancreatic Cancer Chemotherapy When Survival Curves Cross

RMST (restricted mean survival time) comparing 2 first-line chemotherapies for advanced pancreatic cancer when survival curves cross, with adjustment.

Multiple Regression | Factors Associated With Dementia Caregiver Burden

Multiple regression with 8 prespecified factors for burden and quality of life in family caregivers of people with dementia, with principal components.

Multiple Regression | Monthly Antimicrobial Use and Resistance Over Time

Multiple regression of monthly antimicrobial use and the proportion of resistant Pseudomonas aeruginosa, after unit root tests and differencing.

Cox Regression | Recurrence After 2 Methods of Atrial Fibrillation Ablation

Cox regression comparing recurrence after 2 methods of catheter ablation for atrial fibrillation, with 6 subgroups read from tests of interaction.