Modelling clinical trials in heterogeneous samples