Hi, I need a help to create group mean (estimated) lines on spaghetti plot. I want to create one graph that can show all participants' data in gray color while show group mean in two different color lines.
Two groups (Group 0, 1), each group has 50 participants
We measured vigor five times a day for eight days.
"NEWplanned" is the one that we created to show total 40 (5x8) observations for each participant.
I created spaghetti plot for all participants using the following code:
xtline EMA_vigor , t(NEWplanned) i(ID) overlay
then, I created each group plot:
xtline EMA_vigor if Group==0 , t(NEWplanned) i(ID) overlay
xtline EMA_vigor if Group==1 , t(NEWplanned) i(ID) overlay
Is there a way to create one graph that can show all participants' data in gray color while showing group mean in two different color lines (Group 0 = red color; Group 1 = blue color)?
I would sincerely appreciate your suggestions and recommendations.
Sam
Two groups (Group 0, 1), each group has 50 participants
We measured vigor five times a day for eight days.
"NEWplanned" is the one that we created to show total 40 (5x8) observations for each participant.
I created spaghetti plot for all participants using the following code:
xtline EMA_vigor , t(NEWplanned) i(ID) overlay
then, I created each group plot:
xtline EMA_vigor if Group==0 , t(NEWplanned) i(ID) overlay
xtline EMA_vigor if Group==1 , t(NEWplanned) i(ID) overlay
Is there a way to create one graph that can show all participants' data in gray color while showing group mean in two different color lines (Group 0 = red color; Group 1 = blue color)?
I would sincerely appreciate your suggestions and recommendations.
Sam
Comment