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!
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!
Comment