Dear forum, I have a set of longitudinal patient data representing patient id (subjid), time in study (time), lab reading (aval) and a dose indicator variable (dose) that can take values 0, 1 or 2. Each patient's dose can change over the study time course.
I would like to produce a line plot for each patient (5 patients per chart) of aval (y axis) vs. time (x axis).
I would like the line colour for each patient to be red if dose=0, orange if dose=1 and green if dose=2. As each patient can change dose over time, each individual line plot should be capable of changing colour over time according to what the dose indicator is at that time point.
I'm using STATA 12.2. Any help much appreciated!