SQL, data modeling, data quality, EDA, visualization · insight-1069
Try several histogram bin widths and check density plots for impossible values
- Evidence type
- documented fact
- Difficulty
- easy
- Roles
- Data analyst, Data scientist
- Industries
- cross-industry
Summary: situation, action, reason, boundary
Situation
A fare distribution is shown as one histogram with software-default bins, and a "second peak" is discussed in a meeting.
Action
Plot at least three bin widths (or bandwidths), keep a feature only if it persists, and clip or bound density plots at physical limits. State the bin width on the chart and mark zero or capacity limits.
Reason
Binning and smoothing are analysis choices that trade variance against bias, so a pattern that appears for one choice is weak evidence.
Boundary
Distribution checks in EDA, fare, delay and booking-lead-time profiles.
Symptom or risk
The apparent shape depends on bin width: narrow bins create jagged noise, wide bins erase real features, and a smoothed density can extend into negative fares.
Exceptions
Naturally discrete data, where bins should align to the integer values.
Trade-offs
Several panels use space; an ECDF avoids binning entirely.
Pitfalls
Choosing the bin width that makes the story fit.
Lessons and concepts
Claims and their sources
Wilke notes that histogram appearance depends strongly on bin width and recommends exploring several widths, that density bandwidth plays the same role, and that density estimates should be verified not to predict nonsensical values.