How to include df in logistic model and generate graph like below with different degress of greedom? This graph is from page 39 of stata bulletin 42 (attached below).

Array