Dear Statalist:
This seems like a simple question, but I can't seem to find an answer.
I am using Stata 13.1.
I have a monthly time series data set involving employees. The data set is at the employee-month level. The variable of interest is sales. Each employee belongs to one of two groups, X and Y.
I would like to create a time series graph showing (A) average monthly sales, (B) by group, (C) with 95% confidence intervals superimposed as areas.
I can achieve (A) and (B) with the following:
However, I can't figure out how to accomplish (C). I also suspect my method is not the most elegant for (A) and (B).
Any help would be much appreciated!
Thank you,
Jennifer
This seems like a simple question, but I can't seem to find an answer.
I am using Stata 13.1.
I have a monthly time series data set involving employees. The data set is at the employee-month level. The variable of interest is sales. Each employee belongs to one of two groups, X and Y.
I would like to create a time series graph showing (A) average monthly sales, (B) by group, (C) with 95% confidence intervals superimposed as areas.
I can achieve (A) and (B) with the following:
Code:
tsset employee month, monthly collapse (mean) sales, by(group month) tsline sales if group=="X" || tsline sales if group=="Y"
Any help would be much appreciated!
Thank you,
Jennifer
Comment