Announcement

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

  • Plotting two matrices on a coefficient plot

    Hi everyone,

    I have created two matrices (spring_matrix) and (sensitivity_spring_matrix) which both have the mean & SE of sleep duration over a number of days.

    I have created coefficient plots for each matrix separately using the following code:
    Code:
    coefplot mat(spring_matrix), se(2) vertical xlab(1 "Tues" 2 "Wed" 3 "Thur" 4 "Fri" 5 "Sat" 6 "Sun" 7 "Mon" 8 "Tues" 9 "Wed" 10 "Thur") xtitle("Day", height(5)) ytitle("Mean sleep duration (mins) +/-SEM", height(5)) graphregion(color(white)) plotregion(lc(white)) ylabel(, nogrid)
    
    coefplot mat(sensitivity_spring_matrix), se(2) vertical xlab(1 "Tues" 2 "Wed" 3 "Thur" 4 "Fri" 5 "Sat" 6 "Sun" 7 "Mon" 8 "Tues" 9 "Wed" 10 "Thur") xtitle("Day", height(5)) ytitle("Mean sleep duration (mins) +/-SEM", height(5)) graphregion(color(white)) plotregion(lc(white)) ylabel(, nogrid)
    My question is how can I include both matrices in one coefficient plot? I'd like the data for the sensitivity_spring_matrix to be in grey and offset to the right of the data for the equivalent day of the spring_matrix.

    Many thanks in advance!

    Mel

  • #2
    A nice example here: https://www.statalist.org/forums/for...ls-in-coefplot. Note that coefplot is from SSC, as you are asked to explain in FAQ Advice #12.

    Comment


    • #3
      That's perfect - thank you!

      Comment

      Working...
      X