Announcement

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

  • Admetan: edit graph

    Hi,

    Does anyone know how to manipulate the confidence interval in the graph?
    I would like to have an arrow for the lower confidence interval, so I don't have to have a broad x-axis. I would like it to have an x-axis of minimum 0.01. I have tried using "force", searching the web and in here.

    Code:
    gen lnor = ln(or)
    gen lnlci = ln(lci)
    gen lnuci = ln(uci)
    
    admetan lnor lnlci lnuci, study(id) eform effect(OR)  ///
         nowt nooverall forestplot(nobox favours(Decreased Risk#Increased Risk) xlabel(0.01 0.05 0.1 0.2 0.5 1 2 5))
    Send it to the Server

    Can you help me?

    Best regards,
    Katrine
    Attached Files

  • #2
    Hi Katrine,

    You can specify option
    Code:
    forestplot(cirange(.01 5))
    to restrict the range of the CIs. Any CI endpoint that extends beyond this range will be represented by an arrow. Your new code should look like
    Code:
     admetan lnor lnlci lnuci, study(id) eform effect(OR) nowt nooverall ///
                  forestplot(nobox favours(Decreased Risk#Increased Risk) xlabel(0.01 0.05 0.1 0.2 0.5 1 2 5) cirange(.01 5))

    Comment


    • #3
      Hi Katrine,

      Further to Houssein Assaad (StataCorp) 's advice: the cirange() option will restrict the range of the CIs, but will not change the width of the plot. To do this, you'd need to use either the xlabel( ... , force) option or the range() option, as follows:

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input str36 id float(or lci uci)
      "Men"                                   .05 .001  .41
      "Women"                                1.76  .98 3.15
      "Age <65"                               .22  .09  .56
      "Age 65-74"                            1.44  .78 2.68
      "Age >=75"                             2.67 1.38 5.16
      "Married"                              1.14  .63 2.05
      "Unmarried"                             .05  .01  .41
      "Length of stay"                       1.09 1.01 1.17
      "Basic school"                          .05  .01  .41
      "Upper secondary or vocational school"  .78  .42 1.44
      "Higher education"                      .64   .3 1.36
      "TU-score 0"                            .05  .01  .41
      "TU-score >=1"                          .68  .38 1.19
      end
      
      gen lnor = ln(or)
      gen lnlci = ln(lci)
      gen lnuci = ln(uci)
      
      admetan lnor lnlci lnuci, study(id) eform effect(OR) ///
          nowt nooverall forestplot(nobox favours(Decreased Risk#Increased Risk) xlabel(0.01 0.05 0.1 0.2 0.5 1 2 5) cirange(.01 5))
      
      admetan lnor lnlci lnuci, study(id) eform effect(OR) ///
          nowt nooverall forestplot(nobox favours(Decreased Risk#Increased Risk) xlabel(0.01 0.05 0.1 0.2 0.5 1 2 5, force))
      
      admetan lnor lnlci lnuci, study(id) eform effect(OR) ///
          nowt nooverall forestplot(nobox favours(Decreased Risk#Increased Risk) xlabel(0.01 0.05 0.1 0.2 0.5 1 2 5) range(.01 5))

      Note that you could also improve the presentation of your subgroup categories (with the exception of "length of stay" which I'm assuming is continuous) using something like:

      Code:
      gen subgroup = "Sex" in 1/2
      replace subgroup = "Age" in 3/5
      replace subgroup = "Marital status" in 6/7
      replace subgroup = "Education" in 9/11
      replace subgroup = "TU score" in 12/13
      
      admetan lnor lnlci lnuci if !missing(subgroup), study(id) eform effect(OR) by(subgroup) ///
          nowt nooverall nosubgroup forestplot(nobox favours(Decreased Risk#Increased Risk) xlabel(0.01 0.05 0.1 0.2 0.5 1 2 5) range(.01 5))

      Hope that helps,

      David.


      Comment


      • #4
        Thank you so much, you have helped my tremendously and relieved me of many frustrations

        Best regards,
        Katrine

        Comment

        Working...
        X