Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Advice on scatterplot

    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)


    Attached Files

  • #2
    I recommend papers that will be found in Stata with

    Code:
    search gr0041, entry
    
    search gr0098, entry
    which among other ideas push the notion that differences should deserve calculation and display.

    A data example would help. I am travelling right now and cannot follow up with detailed code suggestions.

    Comment


    • #3
      Still hoping for a data example.

      For scores 1 to 5, a scatter plot is likely to obscure as much as it reveals.

      Section 6 of

      https://journals.sagepub.com/doi/pdf...867X1201200314

      explains a graphical approach that may be more suitable.

      Comment

      Working...
      X