Including a python function in a Stata do-file

Including a python function in a Stata do-file

When programming Stata, it is, in some cases, necessary to call an ado file from within a do file, for example in order to calculate p-values and confidence intervals with the information from an estimation command. An alternative can then be to include a python function in the do-file. Here is an example.