Now I tried to graph a two-way scatter graph, with their risk_score as x-axis and OR as y-axis, with 95%Ci. And I only need 2 legends in my graph, which are two dots of OR, but do not need legend of 95% CI (ll/ul)
i tried two ways, by constructing two datasets,
For dataset 1, I pooled all ppl and divided into 2 groups, and here is my code:
Code:
twoway /// (rcap ll ul risk_score, vertical) /// (scatter or risk_score if group == 1, mcolor(red)) /// (scatter or risk_score if group == 2, mcolor(blue)) /// xtitle ("Risk score") ytitle("ORs") legend(label1(2 "OR with male HH") label(3"OR with female HH”)
So I tried another way by using dataset2. My code is:
Code:
twoway scatter or risk_score twoway (scatter male_ors risk_score, yaxis(1)) || rcap male_ll male_ul risk_score /// (scatter female_ors risk_score, yaxis(2)) || rcap female_ll female_ul risk_score /// xtitle ("Risk score") ytitle("ORs") legend(label1(2 "OR with male HH") label(3"OR with female HH")
May I know how to deal with this? Thank you so much!
0 Response to Graph twoway scatter with 95% CI and Odds Ratio
Post a Comment