Hello,
I am trying to generate a spaghetti plot using the "xtline" command, which has worked, however, I am trying to re-colour the lines by group. The code below works to create the plot:
-- xtline NfL , i(ID_visit) t(sample_delay1) overlay legend(off) aspectratio(1) xlabel(5 "0d" 6 "3d" 12 "0d" 13 "3d") ylabel(0(10)70) yscale(range(0 70)) --
However, all of the lines come out as different colours. I have found this option code "plot#opts()" where the # is the plot line, so, for example, I could add -- plot5opts(lcolor(green)) -- which would change plot 5 line to green.
The problem I am having is that this would be very long for every plot line, and I haven't been able to find which plot corresponds to which subject data point.
I am also trying to make the x-axis so the 4 points are distributed equally along the bottom but haven't be able to do that yet.
Would anyone be able to help with this problem to make it more efficient?
Thank you,
Annabelle
I am trying to generate a spaghetti plot using the "xtline" command, which has worked, however, I am trying to re-colour the lines by group. The code below works to create the plot:
-- xtline NfL , i(ID_visit) t(sample_delay1) overlay legend(off) aspectratio(1) xlabel(5 "0d" 6 "3d" 12 "0d" 13 "3d") ylabel(0(10)70) yscale(range(0 70)) --
However, all of the lines come out as different colours. I have found this option code "plot#opts()" where the # is the plot line, so, for example, I could add -- plot5opts(lcolor(green)) -- which would change plot 5 line to green.
The problem I am having is that this would be very long for every plot line, and I haven't been able to find which plot corresponds to which subject data point.
I am also trying to make the x-axis so the 4 points are distributed equally along the bottom but haven't be able to do that yet.
Would anyone be able to help with this problem to make it more efficient?
Thank you,
Annabelle
Comment