Announcement

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

  • Bland Altman plot

    Hello,

    I have read a paper which provides the following results:
    The Bland and Altman-plot (Figure) showed a mean difference of 1.8 (P = 0.546), LoA of ± 27.3 (39% of mean).
    Click image for larger version

Name:	fig.png
Views:	1
Size:	43.6 KB
ID:	1593153



    Can anyone advise where those statistics were pulled from? What code can be used to produce this output like the p value?

    I would like to produce a similar output for my bland altman plot seen below, which I generated using kappaetc.
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	26.2 KB
ID:	1593154



    Does this show poor agreement?
    Last edited by Joe Tuckles; 06 Feb 2021, 10:25.

  • #2
    The agreement is good insofar as most points lie within the plotted limits (I get 25/27) but poor insofar as there appears to be discernible tilt and fanning, although as always be wary of over-interpreting small samples.

    As the highest values are about 100 times the lowest, it is possible that values should be analysed on the logarithmic scale. .

    See also concord from the Stata Journal.

    Comment


    • #3
      Thanks that's very helpful - the 4 is slightly cut off on the right hand side, and other plots I have generated have also cut off the axis. I can't see how to resize/change the aspect ratio? I used kappatec loa

      Comment


      • #4
        kappaetc, with the loa option, also has a return option that stores some results in r(). The p-value that is reported in #1 is probably from a paired t-test; Stata has a ttest command that implements that.

        The graph that kappaetc produces is very basic; the limits-of-agreement approach really has been a side issue that I have included for completeness. Anyway, you can modify the graph by specifying line-options, scatter-options, and any twoway-options; you can also keep the variables that hold the values for the plot and re-create the plot from scratch for maximum control. This is all documented in the help file. The help file points to other commands, e.g., concord, that provides better defaults and also let you modify the graph.

        Comment


        • #5
          Thanks I think the return option is what I need, I can't see an example in the help of how to use it, I tried different things but not got any results such as:
          Code:
          . kappaetc objective_running subjective_running , loa returnonly
          
          .
          I also tried it without the loa but this was not allowed. Please could you advise how to use it to produce the results it mentions in the help?

          Comment


          • #6
            Type

            Code:
            return list

            Comment


            • #7
              Thanks - for some reason when I do this for comparing two different items (running and then walking), the output is exactly the same for both?
              Last edited by Joe Tuckles; 06 Feb 2021, 14:04.

              Comment


              • #8
                Code:
                . kappaetc objective_running subjective_running , loa
                
                . return list
                
                scalars:
                                  r(N) =  25
                          r(mean_diff) =  -242.9410498046875
                            r(sd_diff) =  145.5867844757412
                             r(loa_ll) =  -528.2859040021353
                             r(loa_ul) =  42.40380439276026
                          r(loa_level) =  95
                
                macros:
                                r(cmd) : "kappaetc"
                               r(cmd2) : "loa"
                Code:
                . kappaetc objective_walking subjective_walking , loa
                
                . return list
                
                scalars:
                                  r(N) =  25
                          r(mean_diff) =  -242.9410498046875
                            r(sd_diff) =  145.5867844757412
                             r(loa_ll) =  -528.2859040021353
                             r(loa_ul) =  42.40380439276026
                          r(loa_level) =  95
                
                macros:
                                r(cmd) : "kappaetc"
                               r(cmd2) : "loa"
                Any idea why the output is identical? Thanks!

                Comment


                • #9
                  You will have to specify either the return or the returnonly option; otherwise, kappaetc leaves previous contents in r() unchanged.

                  Comment


                  • #10
                    Thanks that's great I have sorted! Is there no way to edit axes to prevent numbers/words from cutting off without recreating the plot from scratch?
                    Last edited by Joe Tuckles; 07 Feb 2021, 02:57.

                    Comment


                    • #11
                      Given that kappaetc does not its results to the screen, te axis-labels are supposed to give you the details. Most people will not even want those details in a graph.

                      Code:
                      kappaetc ... , loa twowayopts(ylabel(#5) xlabel(#5))
                      might provide a more typical graph. If you want the details, you can always "hard-code" the labels

                      Code:
                      kappaetc ... , loa twowayopts(xlabel(1.36 139.37))
                      You could get these detailed numbers from the (temporary) variables but I will leave this here.
                      Last edited by daniel klein; 07 Feb 2021, 03:27. Reason: added explanation and cutting down on details

                      Comment


                      • #12
                        Thanks for all your help it is really invaluable! I just have a final question!

                        I have produced this output:
                        Code:
                        . kappaetc objective_running subjective_running, loa returnonly
                        
                        . return list
                        
                        scalars:
                                          r(N) =  27
                                  r(mean_diff) =  -35.76767121862482
                                    r(sd_diff) =  54.47321177044276
                                     r(loa_ll) =  -142.533204410916
                                     r(loa_ul) =  70.99786197366632
                                  r(loa_level) =  95
                        
                        macros:
                                        r(cmd) : "kappaetc"
                                       r(cmd2) : "loa"
                        I want to write a sentence like in my first post: The Bland and Altman-plot (Figure) showed a mean difference of 1.8 (P = 0.546), LoA of ± 27.3 (39% of mean).

                        So would that be: The Bland and Altman-plot (Figure) showed a mean difference of -35.8, LoA of ± 54.47 (?% of mean).
                        Is that correct? If so how do I calculate what the % of the mean is? (39% in the example)?

                        Many thanks!

                        Comment


                        • #13
                          Joe, I have no idea what that number means or how the authors have calculated it; sorry. Perhaps this is explained in the paper (which I definitely do not have the time to look into)?

                          Comment


                          • #14
                            Ah that’s OK, I can’t see an explanation in the paper, but it was worth a try! Thank you for all your help

                            Comment


                            • #15
                              From the graph in #1 the overall mean is about 70 -- and 27.3 divided by 70 gives 39%, which seems to fit.

                              "I have read a paper" -- where? On the face of it if the unreferenced paper is not clear, the best tactic is to email the unstated authors.

                              Comment

                              Working...
                              X