Hello, I am making a bar plot of average qA_total scores by week, and I also have a variable (attendance) that is either "High" or "Low".
I have made two separate bar plots for just the "High" group and just the "Low" group by just keeping one value or the other, but am trying to figure out a way to get them both onto the same plot side-by-side.
Here is some code and data (there is a bit of extra code before the plot just to overlay error bars on there)
I have made two separate bar plots for just the "High" group and just the "Low" group by just keeping one value or the other, but am trying to figure out a way to get them both onto the same plot side-by-side.
Here is some code and data (there is a bit of extra code before the plot just to overlay error bars on there)
Code:
collapse(mean) meanqA_total = qA_total (sd) sdqA_total = qA_total (count) n = qA_total, by(week) gen hiqA_total = meanqA_total + invttail(n-1,0.025)*(sdqA_total / sqrt(n)) gen loqA_total = meanqA_total - invttail(n-1,0.025)*(sdqA_total / sqrt(n)) twoway(bar meanqA_total week) (rcap hiqA_total loqA_total week)
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(qA_total week) str4 attendance . 4 "High" 1 4 "High" 3 4 "Low" 3 4 "Low" 2 4 "Low" 3 4 "High" 3 1 "Low" 3 1 "High" 3 1 "High" 1 1 "High" 1 1 "High" 1 1 "High" 3 1 "Low" 3 2 "High" 1 2 "High" 2 2 "High" 2 2 "High" 2 2 "High" 2 2 "High" 2 2 "High" 2 3 "High" 3 3 "High" 3 3 "High" 2 3 "High" 2 3 "High" 1 3 "High" . 3 "Low" . 4 "High" 3 4 "Low" 3 4 "Low" 3 4 "Low" 3 4 "High" 1 4 "High" 2 4 "High" 1 4 "High" 2 1 "High" 3 1 "High" 2 1 "High" 3 1 "High" 2 1 "High" 3 1 "High" 3 1 "High" . 2 "High" . 2 "High" . 2 "High" . 2 "High" . 2 "High" . 2 "Low" 2 2 "Low" 2 3 "Low" 2 3 "Low" 3 3 "High" 3 3 "High" 4 3 "High" 5 3 "High" 2 3 "High" 3 4 "High" 3 4 "High" 1 4 "High" 1 4 "High" 3 4 "High" 1 4 "High" 3 4 "High" 3 4 "High" 2 1 "High" 2 1 "High" 3 1 "High" 3 1 "Low" 1 1 "High" 3 1 "High" . 1 "Low" . 2 "High" . 2 "High" 1 2 "High" 1 2 "High" 1 2 "High" 1 2 "High" 0 2 "High" . 3 "High" . 3 "High" . 3 "High" . 3 "High" . 3 "High" . 3 "High" 3 3 "High" 3 4 "High" 3 4 "High" 3 4 "High" 3 4 "High" 3 4 "High" 3 4 "Low" 3 4 "High" 3 4 "Low" 3 4 "Low" 3 4 "High" 3 4 "High" 3 1 "Low" 3 1 "Low" 1 1 "High" 0 1 "High" end
Comment