Announcement

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

  • How to make a graph that shows reliable and clinically significant change in particular variable?

    Dear Statalisters,

    I appreciate if anyone can help with how to make a graph showing reliable and clinically significant change in particular variable, something like panel A or B of figure 2 below from a paper. I searched every Stata forum questions and Stata materials related to this plot, including a book on A visual Guide to Stata Graphics (Third Edition) by Michael N. Mitchell, yet nothing matched my question.

    Click image for larger version

Name:	Figure2.png
Views:	1
Size:	166.7 KB
ID:	1683434


    I also have quite similar data to the above study, with the following variables as pasted below:



    - ID is participant ID, with 99 participants (1-99).
    - GAD_0 is depression score at baseline (0-21)
    - GAD_8 is depression score at week 8 (post-intervention time) after clinical intervention (0-20)
    - Dif_GAD_0_8 is difference score between pre- and post-intervention (-7-20)
    - RCCriterion_0_8=4.45312 is the cutoff for assessing the reliable change or reliable improvement. This parameter was estimated based on the formula: 1.96*SEdiff = 1.96*SD* sqrt(2-r1-r2)where SEdiff = SE of the difference; SD = SD of test 1; r1 and r2 are reliability of tests 1 and 2. So, if Dif_GAD_0_8 > 1.96*SEdiff or >4.45312, then we can identify him/her as reliable improvers.
    - Actual_Dif_GAD_0_8 is a dichotomous variable classifying a participant as reliable changer or not based on the above criteria.
    - A clinical cutoff for GAD defined from literature is a score of 13.

    So, with the above data, how can I make a plot of figure 2 (like Panel A) as above, if possible, can you suggest with Stata codes based on Stata data below.

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float ID double(GAD_0 GAD_8) float(Dif_GAD_0_8 RCCriterion_GAD_0_8 Actual_Dif_GAD_0_8)
     1 20  4 16 4.45312 1
     2  4  7 -3 4.45312 0
     3  9  4  5 4.45312 1
     4  7  6  1 4.45312 0
     5 17  6 11 4.45312 1
     6 18  7 11 4.45312 1
     7  7  4  3 4.45312 0
     8 13  5  8 4.45312 1
     9 12  4  8 4.45312 1
    10 18  6 12 4.45312 1
    11  7  1  6 4.45312 1
    12 14  0 14 4.45312 1
    13 12  4  8 4.45312 1
    14 17  5 12 4.45312 1
    15 12  7  5 4.45312 1
    16 21 10 11 4.45312 1
    17  3  2  1 4.45312 0
    18  4  5 -1 4.45312 0
    19  7  5  2 4.45312 0
    20 17  4 13 4.45312 1
    21  5  4  1 4.45312 0
    22 14  5  9 4.45312 1
    23  0  3 -3 4.45312 0
    24  8 10 -2 4.45312 0
    25 12  3  9 4.45312 1
    26 11  9  2 4.45312 0
    27 15  3 12 4.45312 1
    28 21 14  7 4.45312 1
    29 16  4 12 4.45312 1
    30  4  2  2 4.45312 0
    31  8  4  4 4.45312 0
    32  7  5  2 4.45312 0
    33 10  6  4 4.45312 0
    34 16 10  6 4.45312 1
    35 12  3  9 4.45312 1
    36 14  6  8 4.45312 1
    37  4  4  0 4.45312 0
    38  6  5  1 4.45312 0
    39 20  8 12 4.45312 1
    40 15  4 11 4.45312 1
    41 10  5  5 4.45312 1
    42 16  4 12 4.45312 1
    43  4  1  3 4.45312 0
    44 19  5 14 4.45312 1
    45  9  2  7 4.45312 1
    46  6  4  2 4.45312 0
    47 12  7  5 4.45312 1
    48 14  5  9 4.45312 1
    49  7  7  0 4.45312 0
    50 16  7  9 4.45312 1
    51  9  3  6 4.45312 1
    52  1  3 -2 4.45312 0
    53  7  4  3 4.45312 0
    54 20  8 12 4.45312 1
    55 15  4 11 4.45312 1
    56  8  6  2 4.45312 0
    57 13  6  7 4.45312 1
    58 18  7 11 4.45312 1
    59 12  4  8 4.45312 1
    60 16  6 10 4.45312 1
    61  5  4  1 4.45312 0
    62 20  0 20 4.45312 1
    63  7  5  2 4.45312 0
    64 18  6 12 4.45312 1
    65 16 12  4 4.45312 0
    66 19  0 19 4.45312 1
    67 15  8  7 4.45312 1
    68  7  4  3 4.45312 0
    69 20  7 13 4.45312 1
    70 10  3  7 4.45312 1
    71 17 20 -3 4.45312 0
    72  7  9 -2 4.45312 0
    73 14  6  8 4.45312 1
    74 11  7  4 4.45312 0
    75  9  2  7 4.45312 1
    76  7 11 -4 4.45312 0
    77 21  9 12 4.45312 1
    78  3  3  0 4.45312 0
    79 14  9  5 4.45312 1
    80 19  0 19 4.45312 1
    81 16 13  3 4.45312 0
    82  9 16 -7 4.45312 0
    83  8  3  5 4.45312 1
    84  6  4  2 4.45312 0
    85 12  8  4 4.45312 0
    86  6  5  1 4.45312 0
    87 18  4 14 4.45312 1
    88 21  9 12 4.45312 1
    89  7  5  2 4.45312 0
    90  5  4  1 4.45312 0
    91  7  5  2 4.45312 0
    92  4  5 -1 4.45312 0
    93 20 19  1 4.45312 0
    94  1  8 -7 4.45312 0
    95 21  6 15 4.45312 1
    96 13  8  5 4.45312 1
    97  3  4 -1 4.45312 0
    98 11  5  6 4.45312 1
    99 12  5  7 4.45312 1
    end
    I thank you for your advice and help.

  • #2
    Code:
    set scheme s1mono
    label define group_lb 1 `""no reliable or" "clinically significant change""' ///
                          2 `""reliable but" "not clinically significant change""' ///
                          3 `""reliable and" "clinically significant change""' ///
                          4 `""not reliable but" "clinically significant change""'
    gen byte group:group_lb = 1 if GAD_8 <  13 & Dif_GAD_0_8 <  4.45312
    replace group           = 2 if GAD_8 <  13 & Dif_GAD_0_8 >= 4.45312
    replace group           = 3 if GAD_8 >= 13 & Dif_GAD_0_8 >= 4.45312
    replace group           = 4 if GAD_8 >= 13 & Dif_GAD_0_8 <  4.45312
    
    separate GAD_0, by(group) veryshortlabel
    
    twoway scatter GAD_0? GAD_8,             ///
        aspect(1)                            ///
        legend(col(1) pos(4) order(1 2 3 4)) ///
        xline(13) yline(13)               || ///
        function y=x, range(0 21)
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	81.4 KB
ID:	1683472
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you so much Maarten for your excellent codes. It is super-useful.

      Comment

      Working...
      X