Skip to content

missing-data-bias-ehr.md's overall payer_code missingness is off (39.9% vs the real 39.6%) #638

Description

@yakew7

Where: explainers/missing-data-bias-ehr.md, the missingness table's payer_code row: 39.9% 37.5% 48.2% 10.7 pts.

Repro:

import pandas as pd
df = pd.read_csv('Healthcare Readmission/diabetic_data.csv')
print((df['payer_code'] == '?').mean() * 100)                              # 39.5574... -> 39.6%
print((df[df.race == 'Caucasian']['payer_code'] == '?').mean() * 100)      # 37.49 -> 37.5% (matches)
print((df[df.race == 'AfricanAmerican']['payer_code'] == '?').mean() * 100)  # 48.17 -> 48.2% (matches)

The two per-group figures (37.5%, 48.2%) and the 10.7-point gap are all correct - only the stated overall rate is wrong: 39.6%, not 39.9%. The weight and medical_specialty rows in the same table were independently checked and are exact.

Fix: "39.9%" -> "39.6%" in the payer_code row.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions