I'm using Stata 14.0 in windows. I was curious if there is a way to overlay two mixed model graphs.
I have data in 6 months on physical activity and temperature. I used mixed model to get the trend of physical activity during the 6 months.
xtmixed time_exercise i.week ||study_id:,
margins i.week
marginsplot, noci
I did the same to see the trend in temperature during the 6 months
xtmixed wk_temperature i.week ||study_id:,
margins i.week
marginsplot, noci
So I got two graphs : one is physical activity (y axis) vs. week (x axis), the other is temperature (y axis) vs. week (x axis). I'd like to know how can I overlay these two graphs together.
I have seen some graphs in the literature combined these types of graphs (one plot, one x axis, one y axis. and using two y axis legend to explain). But haven't figured out how to do it in Stata.
Thank you
Xiaochen
I have data in 6 months on physical activity and temperature. I used mixed model to get the trend of physical activity during the 6 months.
xtmixed time_exercise i.week ||study_id:,
margins i.week
marginsplot, noci
I did the same to see the trend in temperature during the 6 months
xtmixed wk_temperature i.week ||study_id:,
margins i.week
marginsplot, noci
So I got two graphs : one is physical activity (y axis) vs. week (x axis), the other is temperature (y axis) vs. week (x axis). I'd like to know how can I overlay these two graphs together.
I have seen some graphs in the literature combined these types of graphs (one plot, one x axis, one y axis. and using two y axis legend to explain). But haven't figured out how to do it in Stata.
Thank you
Xiaochen
Comment