Data Science – Medicine Application Project 2 Part 2

Comparing postoperative outcomes without losing clinical meaning

The first part defined the cohort and checked its structure. The next step compares the two operative indication groups.

Postoperative air leak, chest tube duration, and hospital stay are measured in days. These variables are bounded at zero and often have long right tails. A small number of patients can remain in hospital much longer than the typical patient. Means and standard deviations alone may hide this pattern.

Why use the Mann-Whitney U test

The Mann-Whitney U test compares the ordering of observations between two independent groups. It does not require a normal distribution. It is useful here because the outcomes are skewed and contain many tied values.

The test is reported with three additional pieces of information.

– Median and interquartile range in each group

– Bootstrap confidence interval for the difference in medians

– Rank-biserial correlation as an effect size

A rank-biserial value near zero indicates strong overlap between the groups. Positive values indicate larger values in the recurrent-pneumothorax group. Negative values indicate larger values in the prolonged-air-leak group.

Three related outcomes are tested. Benjamini-Hochberg correction controls the false-discovery rate within this small family.

| Outcome | Recurrent pneumothorax | Prolonged air leak | Median difference | Rank-biserial r | Adjusted q |

|—|—:|—:|—:|—:|—:|

| Postoperative air leak, days | 0.0 [0.0, 1.0] | 0.0 [0.0, 2.0] | 0.0 | -0.014 | 0.993 |

| Chest tube duration, days | 4.0 [3.0, 5.0] | 4.0 [3.0, 5.0] | 0.0 | 0.000 | 0.993 |

| Hospital stay, days | 4.0 [4.0, 5.0] | 4.0 [3.0, 4.0] | 0.0 | 0.053 | 0.840 |

The detailed estimates and bootstrap intervals are in `tables/03_postoperative_outcomes.csv`.

The results show substantial overlap. The adjusted q-values are large and the rank-biserial effects are close to zero. This is more informative than saying that the tests were not significant. The observed group differences are also small in practical terms.

Postoperative course of operative indication with three distribution charts.
Figure 2. Postoperative outcomes by operative indication. The boxes and distribution shapes show wide overlap between groups for all three outcomes.

Categorical comparisons

Categorical variables require a different test. A chi-square test is used when expected cell counts are adequate. Fisher’s exact test is reserved for sparse two-by-two tables.

The p-value answers a narrow question about evidence against independence. Two effect measures add context.

– The odds ratio shows the direction and size of a two-group association.

– Cramer’s V shows the overall strength of association on a scale from 0 to 1.

| Characteristic | Complete n | Odds ratio | 95% CI | Cramer’s V | Adjusted q |

|—|—:|—:|—:|—:|—:|

| Male sex | 650 | 1.05 | 0.66 to 1.66 | 0.002 | 1.000 |

| Right side | 650 | 1.01 | 0.71 to 1.44 | 0.000 | 1.000 |

| Smoking history | 650 | 1.15 | 0.81 to 1.64 | 0.027 | 0.990 |

| Previous tube thoracostomy | 650 | 2.96 | 2.06 to 4.27 | 0.231 | <0.001 |

| Tube during current admission | 650 | 0.71 | 0.44 to 1.16 | 0.051 | 0.769 |

| Bleb or bulla not visualized | 628 | 0.79 | 0.51 to 1.22 | 0.037 | 0.953 |

| Multiple wedge resection | 650 | 1.11 | 0.73 to 1.68 | 0.016 | 1.000 |

| Postoperative complication | 650 | 0.95 | 0.35 to 2.54 | 0.000 | 1.000 |

The full output is in `tables/04_categorical_comparisons.csv`.

Previous tube thoracostomy is the clearest group difference. The odds are about three times higher in the recurrent-pneumothorax indication group. This does not mean that the tube caused the indication. Prior tube treatment and recurrence history are closely connected parts of the clinical pathway.

Graph showing odds ratios for recurrent pneumonia indicators in medical study.
Figure 3. Categorical associations with operative indication. Previous tube thoracostomy shows the strongest group difference. Most other intervals include the null value of 1.

Modeling hospital stay

Hospital stay is a count outcome. A Poisson model provides incidence rate ratios for the expected number of hospital days. Pearson dispersion was 0.14, so there was no sign of extra-Poisson variation. Heteroskedasticity-consistent standard errors were used to avoid relying on an ideal variance assumption.

| Model term | Adjusted incidence rate ratio | 95% CI | p-value |

|—|—:|—:|—:|

| Recurrent-pneumothorax indication | 0.99 | 0.96 to 1.02 | 0.561 |

| Previous tube thoracostomy | 1.12 | 1.09 to 1.16 | <0.001 |

| Each additional air-leak day | 1.06 | 1.05 to 1.07 | <0.001 |

| Postoperative complication | 1.09 | 1.02 to 1.16 | 0.010 |

| Age, per 5 years | 0.99 | 0.98 to 1.01 | 0.432 |

| Male sex | 1.02 | 0.98 to 1.06 | 0.256 |

| Smoking history | 1.00 | 0.97 to 1.03 | 0.860 |

The model is available in `tables/10_length_of_stay_model.csv`. The dispersion check is in `tables/10b_count_model_diagnostics.csv`.

After adjustment, previous tube thoracostomy is associated with an expected stay about 12% longer. Each additional postoperative air-leak day is associated with an expected stay about 6% longer. These are model-based associations. They should not be read as treatment effects.

What we learned from the comparison

The operative indication alone did not explain the postoperative duration outcomes. Specific clinical features carried more information. Previous tube history was related to indication and to expected hospital stay, while postoperative air-leak duration had a direct relationship with length of stay.

Part 3 turns to recurrence. That question needs methods that use both the event and the time under observation.

Leave a Reply

Create a website or blog at WordPress.com

Up ↑

Discover more from Writing my way through ideas.

Subscribe now to keep reading and get access to the full archive.

Continue reading