본문 바로가기
STATA

09. [STATA] Meta-analysis

by Aubreyy 2022. 3. 25.

OR

/* install packages for meta */
ssc install metan
ssc install metabias
ssc install metafunnel
ssc install midas

 

import excel "\\Data1.xlsx", sheet("Fig2") firstrow

 The data we have has variable "Study, OR, LCI, UCI"

The data is from the paper about aspirin and breast cancer (Ting Lue et al, 2012)

/* Forest Plot */
metan OR LCI UCI

 

metan OR LCI UCI, random label(namevar=Study)

metan OR LCI UCI, random label(namevar=Study) sortby(Study)

With above code, you can sort the plot by author's name.

Now, we have to convert the values we have to log to assess the publication bias and get funnel plot.

gen logor = ln(OR)
gen logl = ln(LCI)
gen logu = ln(UCI)
gen selogor = (logu-logl)/(2*invnormal(0.975))

We can make the funnel plot

metafunnel logor selogor

We can get publication bias like below.

metabias logor selogor, egger

HR

It is very similar to the things we've done above. 

After you import your HR data (I have variable Author, Year, HR, LHR, UHR),

metan HR LHR UHR, random label(namevar=Author)
metan HR LHR UHR, random label(namevar=Author) sortby(Author)

 

For funnel plot and publication bias,

gen loghr=ln(HR)
gen loglhr=ln(LHR)
gen loguhr=ln(UHR)
gen selogr=(loguhr-loglhr)/(2*invnormal(0.975))

metafunnel loghr seloghr
metabias loghr selogr, egger

Then you will get similar results.

Getting Sensitivity and Specificity

After you get your sensitivity and specificity data, you can get forest plots of it. I have (tp fp fn tn, sensitivity, specificity, SE_sen, SE_spe) If you want to see author's name, you can use 'graph editor'. You can check this link.

midas tp fp fn tn, bfor(dss) id(Author Year) ford fors

You also can get funnel plot

metafunnel sensitivity SE_sen
metafunnel specificity SE_spe

 

댓글