Announcement

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

  • Issue when plotting confidence interval plots

    Dear all,

    I'm trying to compare 2 different confidence interval plots of the growth rate of 2 diseases in 2 different image modalities and am having some issues when combining these interval plots.
    When calculating the mean and confidence interval of the data of one of the diseases (GA) I get a mean of ~1.66 with a 95% CI of 1.496 to 1.834 for one of the image modalities (FAF), when i put this in an interval plot everything looks good according to the means and confidence intervals (first plot, first CI). However when I try to combine the interval plots from the 2 diseases, suddenly the mean and CI of disease GA in image modality FAF is completely different (see second picture, first plot). I don't know why this is happening or how I can fix this. Could someone help me please?

    THank you!


    Attached Files
    Last edited by Fabiana Bassil; 26 Oct 2023, 07:21.

  • #2
    You meant to show plots, which are not yet visible. What also we need, please, to give a good answer is information about your data and the exact code you used. I suspect it's a simple matter of different data in different plots, but we need details to be definitive.

    Comment


    • #3
      Thank you for your reply! Apologies, I've just added the plots.
      About the data, it's the following list. I'm trying to compare the mean with 95% CI of two mean growth rates (mgrga and mgrstg) by 2 different image modalities (IM; FAF and OCT). THe issue is only with the mean and CI of mgrga in FAF. I've used first the code of "ciplot mgrga, by(IM)" which shows the correct mean and CI. And then the code of "ciplot mgrga mgrstg, by(IM)" when wanting to combine the plots.
      This is my first time using Stata so apologies if anything is unclear and I'd be happy to give more information if needed.

      Thank you!
      Click image for larger version

Name:	Screenshot 2023-10-26 at 15.25.04.png
Views:	1
Size:	279.5 KB
ID:	1731652

      Comment


      • #4
        ciplot is from SSC and was written by me, but in the help for 12 years now I have tried to discourage its use.

        (note added August 2011)

        For fuller flexibility, consider using statsby first and then standard graphics commands (Cox 2010).
        The problem lies in the missing values for mgrstg. With your syntax ciplot works only with observations that are not missing on both variables. You should try the undocumented option inclusive

        Code:
        ciplot mgrga mgrstg, by(IM) inclusive 

        Comment


        • #5
          That was indeed the issue! Thank you so much!

          Comment

          Working...
          X