Individualizing drug dosage with longitudinal data