FixedEffects / FixedEffects.jl

Back end for FixedEffectModels.jl
Other
19 stars 9 forks source link

Feasibility of a stata interface (with docker) #10

Open jlperla opened 5 years ago

jlperla commented 5 years ago

@sergiocorreia (cc @matthieugomez @rsaggio87 ) This is diverging from my original question. We are looking for possible medium-term projects for grad students.

One thing I was wondering about is the feasibility of having stata call out to the something like FixedEffectModels.jl as an experimental interface, but otherwise remain in stata.

What may make this administratively possible is that we could create a docker image that has a FixedEffectsModels.jl prebuilt, with MKL and tweaked libraries. Then users would have no desktop setup (outside of installing docker). The interface could save out the necessary data to be loaded in hdf5 or just csvs, and the either store a file to to be ready for options, or just call it on the command line

Do you think that is feasible in the reghdfeinterface? It is reasonable to initiate shell commands form stata and have control flow around them?

jmboehm commented 5 years ago

This may be a bit off-topic, but I've found it easier to call Stata from julia, than vice versa. This here is my hacked-together attempt at an interface. This could probably be made much better by implementing a REPL in a running Stata session.

jlperla commented 5 years ago

Thanks Johannes. I think it is very on-topic! Although my goal would be to hook the stata-crew into julia rather than the other way around :-)

sergiocorreia commented 5 years ago

It is reasonable to initiate shell commands form stata and have control flow around them?

It's possible but a bit tedious, as e.g. Stata will not stop if there is an error in the shell call. There are two other options:

1) Stata allows for C plugins (SVM, Gtools). Can Julia be available through a C wrapper? 2) Stata 16 has Python integration. Is there a Py-Julia wrapper that we can then use?

jlperla commented 5 years ago

The python is a great idea. While we could in theory call Julia directly (i.e. thorugh https://github.com/JuliaPy/pyjulia ) there are some quirks in the environment. If stata is doing its own thing with python, then I have fears that the setup may be fragile (where the whole point of docker is to remove that sort of fragility so nobody needs to worry about setting up Julia).

However, even if it can't, python is a spectacular glue language so having it call off to a docker image and deal with marshalling the results back and forth could work a lot better than the shell, and be easier to make cross-platform.