The xtewreg Stata command
If you just want to get the Stata command, use [. ssc install xtewreg] from your Stata console. You can then use [. help xtewreg] to learn more about how to use the command.
If you’d like to view the command source code or make changes, the code is available on my GitHub.