Announcement

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

  • Add confidence intervals to graphs

    Hi everyone,

    I have currently plotted a graph using this code but I would like to add the confidence interval of the points plotted to the graph. Is there is a simple way of doing this
    \
    Code:
    graph twoway (scatter fidelity  weeks), by (ETHNICITY)

    Thank you very much for any help.

    Many thanks,


  • #2
    The question is very vague that it's hard to give any concrete suggestion. -rcap- may be an option, if you create the lower and upper bounds with commands like -collapse-.

    Example that may or may not help:

    Code:
    clear
    input x y xu xl yu yl
    10 15 12 8 25 5
    14 19 16 12 21 17  
    end
    
    twoway (scatter y x)(rcap yu yl x)(rcap xu xl y, horizontal)

    Comment


    • #3
      Hey ,

      I am not sure how to create the upper and lower limits. Currently I am trying to create variables for the upper and lower confidence intervals of fidelity which I can then use with rcap. Is there anyway you could perhaps help?
      Last edited by Eli Omo; 20 Feb 2022, 21:28.

      Comment


      • #4
        help metan

        Comment


        • #5
          I just used that code - but its only referring to metaanalysis


          My current problem is that I am don't know how to create the lower and upper bounds for
          fidelity
          variable( on the y-axis) on STATA 16

          Comment


          • #6
            I have tried this code but it did not work:

            Code:
            gen yu = fidelity + 1.96*se_fidelity

            Code:
            gen yl = fidelity - 1.96*se_fidelity
            I get this as an error reply :

            se_fidelity not found
            Last edited by Eli Omo; 21 Feb 2022, 07:58.

            Comment


            • #7
              OP started all over again at https://www.statalist.org/forums/for...ence-intervals

              Comment

              Working...
              X