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
'STATA' 카테고리의 다른 글
08. [STATA] for statement 한꺼번에 확인하기 (0) | 2021.08.17 |
---|---|
07. [STATA] 기초 통계 chi-squared, t-test (0) | 2021.08.06 |
06. [STATA] 테이블 reshape (0) | 2021.08.04 |
05. [STATA] 두 개 테이블 합치기 (0) | 2021.08.03 |
04. [STATA] 변수 생성, 수정, missing value, recoding (0) | 2021.08.02 |
댓글