Page 1 of 1

### How can I plot a caterpillar plot using odd ratios

Posted: Thu Dec 19, 2019 6:22 am
I would like to create a caterpillar plot (serrbar command) after performing a logistic multilevel model (two levels, level 1: patient, level 2: hospital)

I was able to run the caterpillar plot using the coefficient as follows:
xi: runmlwin depv indvars cons, ///
level2(hospital: cons, residuals(u)) level1(case_id:) discrete(distribution(binomial) link(logit) denominator(cons) pql2) nopause
egen pickone_hospital = tag(hospital)
qnorm u0 if pickone_hospital==1, aspectratio(1) scheme(s1mono)
egen u0rank = rank(u0) if pickone_school==1
serrbar u0 u0se u0rank if pickone_hospital==1, scale(1.96) yline(0) scheme(s1mono)

Now I need to run the serrbar using the odd ratio (and not the coefficients) and the 95% CI for the odds ratio.

thank you

### Re: How can I plot a caterpillar plot using odd ratios

Posted: Wed Jan 08, 2020 4:00 pm
Dear nabilshaaban,

You need to first create a dataset with the predicted odds ratio of each hospital and the the associated limits of the 95% CI.

Once you have done that you need to plot the results. You can do this with the twoway command and the scatter option for the point estiamates and the rcap option for the lower and upper limits of the 95% CI. You can't use the serrbar option to do this.

Best wishes

George

### Re: How can I plot a caterpillar plot using odd ratios

Posted: Sun Jan 19, 2020 9:02 am
Dear George,

Please can you provide extract of codes how to do this. Not sure to do this, also in the interested in getting the predicted odds ratio.

Thank you

### Re: How can I plot a caterpillar plot using odd ratios

Posted: Fri Apr 03, 2020 5:00 pm
@nabilshaaban

Please, can show the final code you used in getting odd ratio (and not the coefficients) and the 95% CI for the odds ratio at level.

Thanks