Ideally, subgroup analyses should be pre-specified in the study protocol. Pre-specification reduces the risk of data dredging or p-hacking, where researchers might unintentionally search for significant results through numerous unplanned analyses. Pre-specified subgroup analyses are considered more credible and are less likely to be dismissed as exploratory or hypothesis-generating.