Announcement

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

  • Naming studies in Meta-Analysis

    Dear Statalist-Community,
    I am a quite unexperienced stata user and have some difficulties that some of you may find tivial.
    I am trying to generate a forest plot for hazard ratios for a meta-analysis and also want the actual studies names/ authors to appear.

    I am using code as follows:

    ssc install metan

    set obs 2
    gen hr = 0
    gen lci = 0
    gen uci = 0

    replace hr = 1.437 in 1/1
    replace hr = 1.146 in 2/2
    replace lci = 0.659 in 1/1
    replace lci = 0.840 in 2/2
    replace uci = 3.134 in 1/1
    replace uci = 1.567 in 2/2

    gen lnhr = ln(hr)
    gen lnlci = ln(lci)
    gen lnuci = ln(uci)

    metan lnhr lnlci lnuci, eform effect (HR)

    Stata then returns a forest plot, where the studies are named "1" and "2". How can i enter the actual studies names in stata, so that they are printed into the forest plot?

    I tried it like that but was unsuccessful:
    gen studylbl = 0
    replace studylbl = "actual name of the study" in 1/1
    replace studylbl = "actual name of the other study" in 2/2

    I am very thankful for your help!
    Last edited by Thilo Stolze; 30 Jan 2021, 14:46.

  • #2
    Code:
    clear
    set obs 2
    gen hr = 0
    gen lci = 0
    gen uci = 0
    
    replace hr = 1.437 in 1/1
    replace hr = 1.146 in 2/2
    replace lci = 0.659 in 1/1
    replace lci = 0.840 in 2/2
    replace uci = 3.134 in 1/1
    replace uci = 1.567 in 2/2
    
    gen lnhr = ln(hr)
    gen lnlci = ln(lci)
    gen lnuci = ln(uci)
    gen studylbl = "actual name of the study" in 1/1
    replace studylbl = "actual name of the other study" in 2/2
    label variable studylbl "Study"
    metan lnhr lnlci lnuci, eform effect (HR) lcols(studylbl)
    Producing:
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	35.1 KB
ID:	1592147

    Comment


    • #3
      Thank you so much, Ali Atia! That has solved the problem.

      Comment

      Working...
      X