Skip to content

Coming from EViews

In the app: Help → Help contents, Coming from EViews.

pymetrix covers most of what EViews is used for in applied macroeconomics, from a data file to a forecast report. This page says where the familiar things are. Find anything (Ctrl+K) knows the EViews names too: type genr, smpl or ls and it offers the pymetrix command.

The objects

  • Workfile: a project (File → Save project, a .pymx file), which keeps the data and every step that made the results, and rebuilds them when opened. A page is a Dataset: one per frequency or panel structure, as many as needed in a project.
  • Series: a column of a Dataset; data["y"] is a pandas Series indexed by period. Lags are written y[-1], not y(-1); functions such as d, dlog, log and @pch (written pch) work as in EViews.
  • Group: a selection of series (Data → Select series…, data.series("c", "i")).
  • Sample: the dataset's active sample (Data → Sample → Set sample…); a named sample is a Sample.
  • Equation object: an Equation is the specification; estimating it gives a FittedEquation, whose window tabs are the views (estimation output, residuals, tests, forecast). Coefficients are named, not c(1): fit.params["y"].
  • System and VAR: System gives a FittedSystem, VAR a FittedVAR.
  • Model object: a Model of estimated equations and identities; scenarios are Scenario objects (shift, set, fix, hold and free), and scenarios(...) solves several and compares them (a ScenarioSet).
  • Spool, report and frozen tables: every result is already an object; collect them in the report outline (Add to report, under any table or figure; View → Report) and export it (File → Export report…), or write a Report in code.
  • Program and the command window: Python scripts (File → New script) and the Immediate window (View → Immediate).

Commands and menus

In the Python column, data is a Dataset, fit an estimated equation, var an estimated VAR and model a Model. Each menu item records its Python in the History and Script windows, and each dialog field's tooltip names its argument.

Familiar In the app In Python
wfopen, import, read: open a data file File → Load data… data = Dataset.read("macro.xlsx", time="date", freq="Q")
dbopen, fetch: fetch from a database File → Load from connector… Dataset.read("fred://GDPC1")
wfcreate, pagecreate: a new, empty workfile page File → New dataset… data = Dataset.empty("Q", "1990Q1", "2030Q4")
wfsave: save the workfile File → Save project
genr, series: a new series, computed once Data → Generate series… data = data.with_series(dy="d(y)")
frml: a series that follows its formula Data → Derived series… data = data.derive(dly="dlog(y)")
smpl: the active sample Data → Sample → Set sample… data = data.with_sample(("2000Q1", "2019Q4"))
smpl then y =: assign a series within a sample Data → Generate series… data = data.with_series(y="x / 2", within=("2000Q1", "2019Q4"))
sample: a named sample Data → Sample → New sample… Sample(start="2000Q1", end="2019Q4")
group: a group of series Data → Select series… data.series("c", "i", "g")
line, graph, plot: graphs of series Data → Plot series… data.plot(["c", "y"])
stats: descriptive statistics Data → Statistics → Descriptive statistics… data.describe()
cor, cov: correlations Data → Statistics → Correlations… data.corr()
copy, frequency conversion: change frequency Data → Transform → Convert frequency… data.to_freq("Y")
x13, x12: X-13ARIMA-SEATS seasonal adjustment (the pymetrix-seasonal plugin) Data → Transform → Seasonal adjustment… data.seasonal_adjust("c", pymetrix_seasonal.X13())
tramo: TRAMO-SEATS seasonal adjustment (the pymetrix-seasonal plugin) Data → Transform → Seasonal adjustment… data.seasonal_adjust("c", pymetrix_seasonal.TramoSeats())
seas: seasonal adjustment by moving averages Data → Transform → Seasonal adjustment… data.seasonal_adjust("c", Classical())
hpf: Hodrick-Prescott filter Data → Transform → Filter (trend and cycle)… data.filter("y", HP())
ls: least squares Estimate → Equation… fit = Equation("c ~ y + c[-1]").fit(data)
tsls: two-stage least squares Estimate → Equation… Equation("c ~ y + c[-1]").fit(data, method=IV(endog=["y"], instruments=["g", "g[-1]"]))
arch: ARCH and GARCH Estimate → Equation… Equation("y ~ 1", variance=GARCH(1, 1)).fit(data)
logit, probit, binary: binary choice Estimate → Equation… Equation("d ~ x", family=Logit()).fit(data)
system, sur, 3sls: a system of equations Estimate → System of equations… System([Equation("c ~ y"), Equation("i ~ y[-1]")]).fit(data, method=SUR())
var: a VAR Estimate → VARs and local projections → VAR… var = VAR(["c", "i", "y"], lags=2).fit(data)
impulse: impulse responses Estimate → VARs and local projections → Impulse responses… var.irf(20)
decomp: variance decomposition Estimate → VARs and local projections → Variance decomposition… var.fevd(20)
coint: Johansen cointegration test Test → Johansen cointegration… data.johansen(["c", "y"], lags=2)
uroot: unit-root test Test → Run test… data.test("adf", "y")
auto: serial correlation LM test Test → Run test… fit.test("breusch_godfrey", lags=4)
hettest, white: heteroskedasticity tests Test → Run test… fit.test("white")
archtest: ARCH LM test Test → Run test… fit.test("arch", lags=4)
hist, jbera: normality of residuals Test → Run test… fit.test("jarque_bera")
reset: Ramsey's RESET Test → Run test… fit.test("reset")
chow: Chow breakpoint test Test → Run test… fit.test("chow", at="2008Q1")
wald: Wald test of coefficient restrictions Test → Run test… fit.wald("y = 0.5")
correl: correlogram and Q statistics Test → Correlogram… fit.correlogram(12)
forecast, fit: forecast from an equation Forecast → Forecast… fit.forecast(data, ("2020Q1", "2021Q4"), dynamic=True)
model, append: a model object Model → Model editor… model = Model([fit, Equation("y = c + i + g")])
solve: solve a model Model → Solution → Solve model… model.solve(data, ("2020Q1", "2024Q4"))
addinit: add factors Model → Solution → Add factors… model.add_factors(data)
scenario, override: scenarios Model → Scenarios → Compare scenarios… model.solve(data, ("2020Q1", "2024Q4"), scenario=Scenario(shift={"g": 5.0}))
stochastic: stochastic simulation Model → Solution → Solve model… model.solve(data, ("2020Q1", "2024Q4"), draws=1000)
sspace: a state-space object Model → Import → EViews state-space object… read_eviews_sspace(text)
freeze: keep a table or graph File → Save result… save_result(fit, "consumption")
spool, report: collect output in a document View → Report Report("Forecast round").add(fit).save("round.docx")
program, run, exec: a program (.prg) File → Open script…
command window: type commands View → Immediate

Defaults that differ

The ADF test chooses its lags by AIC, where EViews uses the Schwarz criterion (lags="bic" matches it); the HP filter's lambda follows the frequency, as in EViews. These, the robust and HAC standard errors and the VAR and SUR residual covariances are set out, with the option that matches, in Defaults, and other packages' defaults. One more: a series made under the active sample is computed over all the data (the active sample only chooses the rows that estimation, tests and graphs use); to assign only within a sample, as genr under smpl does, give it under Within in Generate series (data.with_series(y="x / 2", within=("2000Q1", "2019Q4"))).

Different by design

  • Every step is recorded. Each dialog runs one line of Python, listed in the History and Script windows; File → Export script… saves them as a script that reproduces the work outside the app.
  • Results are not changed in place. Estimating again makes a new result; data.with_series(...) returns a new dataset. A derived series keeps its formula and follows its inputs (EViews' frml).
  • Undo. Edit → Undo (Ctrl+Z) takes back the last dialog step, up to 20; session.undo() in code.
  • Projects rebuild. A project saves the data and the steps; results are recomputed when it opens, and a result whose inputs changed is marked out of date.

Bringing work across

Seasonal adjustment: X-13ARIMA-SEATS and TRAMO-SEATS come with the seasonal plugin, pymetrix-seasonal (pip install "pymetrix-seasonal[jdemetra]"); installed, they are methods in the same Seasonal adjustment dialog, beside STL and classical decomposition, which need nothing more.

Data: save the workfile's series as Excel or CSV and use File → Load data…; workfiles (.wf1) are not read. Models: read_eviews reads a model's text or a program (.prg) into a template, fitting its equation eq.ls specifications to data when given; read_eviews_xml reads an FRB/US-style XML model file and read_eviews_sspace a state-space object. In the app, Model → Model editor… reads EViews model text as typed, and its Write as button translates a model to pymetrix's syntax, Dynare's or IRIS's (Model → Export model…; export_model in code). Model.from_file reads any of these by its extension.

See also