Hi everyone,
I'm trying to create a figure to display results from a pre- and post-training survey. I used the wilcoxon signed-rank test to assess statistical significance. So far in Stata I've been able to create a scatter plot with connecting lines for each pre- and post-training observation. The thing I can't figure out is how to show the individual number of observations in the scatter plot for participants who have the same pre- and post-scores, which are then obscured by this figure - would appreciate advice on how to update my code to create a figure that looks more like the attached figure.
I am also wondering how to add an overall trendline for either the mean or median score for each time point. Would appreciate advice on if mean or median would be preferred with the signed-rank test, and how to add this code to my current code.
Here is my current code:
twoway (scatter pasttrauma prepost, mcolor(blue) msize(small)) ///
(connected pasttrauma prepost, lcolor(blue)), ///
ylabel(1 2 3 4 5) ///
xlabel(0 "Pre-training" 1 "Post-training") ///
ytitle("Self-reported score (1-5)") ///
xtitle("") ///
xscale(range(-0.25 1.25)) ///
yscale(range(0 6)) ///
legend(off) ///
text(5.5 0.5 "p = 0.09", size(medium) color(black) lwidth(medsmall)) ///
title("Comfort with asking patients about past trauma", size(medium)) ///
name(scatter_pasttrauma, replace)
I'm trying to create a figure to display results from a pre- and post-training survey. I used the wilcoxon signed-rank test to assess statistical significance. So far in Stata I've been able to create a scatter plot with connecting lines for each pre- and post-training observation. The thing I can't figure out is how to show the individual number of observations in the scatter plot for participants who have the same pre- and post-scores, which are then obscured by this figure - would appreciate advice on how to update my code to create a figure that looks more like the attached figure.
I am also wondering how to add an overall trendline for either the mean or median score for each time point. Would appreciate advice on if mean or median would be preferred with the signed-rank test, and how to add this code to my current code.
Here is my current code:
twoway (scatter pasttrauma prepost, mcolor(blue) msize(small)) ///
(connected pasttrauma prepost, lcolor(blue)), ///
ylabel(1 2 3 4 5) ///
xlabel(0 "Pre-training" 1 "Post-training") ///
ytitle("Self-reported score (1-5)") ///
xtitle("") ///
xscale(range(-0.25 1.25)) ///
yscale(range(0 6)) ///
legend(off) ///
text(5.5 0.5 "p = 0.09", size(medium) color(black) lwidth(medsmall)) ///
title("Comfort with asking patients about past trauma", size(medium)) ///
name(scatter_pasttrauma, replace)
Comment