Hi everyone,
I’m working with panel data containing information on id, blood sampling date, protein levels and sex. Blood is sampled twice in some study participants and three and four times in others. There is usually 3-12 months between each sampling time.
I can display the individual graphs of these protein levels over time using xtline. However, now I’d like to graph them and color them according to sex. Does anyone know how to do this? I’ve tried with xtline, twoway graph and linkplot but nothing has worked so for.
My code for xtline is: xtline protein, overlay i(id) t(days_from_first_sampling)
And the graph that is generated is attached.
I'm using Stata v16.1 (on Mac).
Hope someone has a solution to this. Many thanks!
Gunnar
I’m working with panel data containing information on id, blood sampling date, protein levels and sex. Blood is sampled twice in some study participants and three and four times in others. There is usually 3-12 months between each sampling time.
I can display the individual graphs of these protein levels over time using xtline. However, now I’d like to graph them and color them according to sex. Does anyone know how to do this? I’ve tried with xtline, twoway graph and linkplot but nothing has worked so for.
My code for xtline is: xtline protein, overlay i(id) t(days_from_first_sampling)
And the graph that is generated is attached.
I'm using Stata v16.1 (on Mac).
Hope someone has a solution to this. Many thanks!
Gunnar
Comment