Migrating from Stata to Python
Asked Answered
C

5

9

Some coworkers who have been struggling with Stata 11 are asking for my help to try to automate their laborious work. They mainly use 3 commands in Stata:

tsset (sets a time series analysis)

as in: tsset year_column, yearly

varsoc (Obtain lag-order selection statistics for VARs)

as in: varsoc column_a column_b

vec (vector error-correction model)

as in: vec column_a column_b, trend(con) lags(1) noetable


Does anyone know any scientific library that I can use through python for this same functionality?

Ceballos answered 15/10, 2010 at 21:16 Comment(0)
M
7

I believe both scikits.timeseries and econpy / pytrix implement vector autoregression methods, but I haven't put either through their paces.

Motmot answered 15/10, 2010 at 23:5 Comment(0)
N
5

scikits.timeseries is mainly for data handling and has only some statistical, econometric analysis and no vectorautoregression. pytrix has some econometrics functions but also no VAR. (At least last time I looked.)

scikits.statsmodels and pandas both have VAR, pandas also does the data handling for time series. I haven't seen any vector error correction models in python yet, but scikits.statsmodels is getting close.

http://groups.google.ca/group/pystatsmodels?hl=en&pli=1

Nationalize answered 18/10, 2010 at 2:30 Comment(0)
W
4

Check out scikits.statsmodels.tsa.api.VAR (may need to get the latest development version--use Google) and, in check out the documentation for it:

http://statsmodels.sourceforge.net/devel/vector_ar.html#var

These models integrate with pandas also. I'll be working in the coming months to improve integration of pandas with the rest of statsmodels

Vector Error Correction Models have not been implemented yet but are on the TODO list!

Wrennie answered 30/5, 2011 at 22:12 Comment(0)
K
2

Use Rpy2 and call the R var package.

Karleen answered 1/1, 2011 at 0:22 Comment(0)
F
0

I have absolutely no clue what any of those do, but NumPy and SciPy. Maybe Sage or SymPy.

Forwarding answered 15/10, 2010 at 22:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.