tlamadon / pytwoway

Two way models in python
MIT License
22 stars 6 forks source link

Simple tutorial on using PyTwoWay from stata 17 #41

Open tlamadon opened 1 year ago

tlamadon commented 1 year ago
  1. install using a shell command: shell pip install pytwoway
  2. pass data from Stata to Python
  3. run estimator
  4. extract results back to stata and show
adamoppenheimer commented 1 year ago

Once I'm on winter break I'm going to try out pyoxidizer to get a standalone executable.

Once that's working I'll update the Stata interface so you'll be able to run the Stata command with just the executable even if you don't have Python.

tlamadon commented 1 year ago

Thanks Adam, I might try to put something simple together, just because some people are asking. Hope all is good!

tlamadon commented 1 year ago

I created a page on the wiki and a stata branch. See details here:

Pytwoway with Stata on Apple silicon (M1, M2, etc)

shoham-b commented 1 year ago

Since using pandas and numpy, I think it would be better to use PyInstaller. See https://pyoxidizer.readthedocs.io/en/v0.9.0/packaging_additional_files.html#installing-unclassified-files-on-the-filesystem

adamoppenheimer commented 1 year ago

Thank you for the recommendation @shoham-b.

I will take a look at the link you posted once I get to creating the executable.

tlamadon commented 1 year ago

The way I have moved the library to off line servers if by using conda-pack. We could provide a simple tutorial for it. If you can set it up locally using conda, you can then relatively easily pack it into one file that you can then move to the server.

In all cases, that file (or any executable) will end up pretty large, at least several 100M.