Selection bias appears when the route into a dataset depends on the outcome being studied, or on something tied to it.
It is especially hard to spot because the data looks complete, while the missing cases leave no trace.
It can create links that do not exist or hide links that do.
Survivorship is a common form, such as studying only funds still open, which hides the ones that closed after losing money.
Self-selection is another, where people who choose to take part differ from those who do not.
Attrition, where people leave a study over time, biases results if those who leave differ from those who stay.
Hospital data can make 2 unrelated conditions look linked, because having either one raises the chance of admission.
Selecting on a shared consequence like admission is one of the most common ways false links arise.
Unlike confounding, selection bias can affect even a randomised trial if many people drop out.
Analysing everyone in the group they were originally assigned to, called intention to treat, protects trials against it.
In business data, studying only active customers hides the ones who left, often the most informative group.
Weighting or modelling the selection can help when the reasons people were included are known and measured.
When the reasons are unknown, the safest step is to describe the limitation clearly.
In practice, tracing the path each case takes into the data, and who drops out at each step, reveals most selection problems.
The usual mistake is analysing whatever data happens to exist without asking who is missing and why.