/* This figure is not equal to the one in the text book, since limiting the range on the y-axis is done most easily by limiting the range on the x-axis. */ local cmd "function y = x, range(1 4) xtitle("Risk ratio") ytitle("Odds ratio") legend(off)" forvalues p = 0.02(0.02)0.2 { local cmd "`cmd' || function y=((1/`p')-1)/((1/`p')-x)*x, range(1 4)" } twoway `cmd'