# Command Reference

## Introduction

The commands defined below may be executed in the command-line client program. They may also be placed in a script file for execution in the GUI, or entered using the latter's console mode. In most cases the syntax given below also applies when you are presented with a line to type in a dialog box in the GUI (but see also gretl's online help), except that you should not type the initial command word — it is implicit from the context. One other difference is that some commands support option flags, but you cannot enter these in GUI dialog boxes; generally there are menu items which achieve the same effect.

The option flags shown below are in long form, with a somewhat mnemonic term preceded by two dashes. There are also corresponding short forms: these are shown in .

The following conventions are used below:

- A `typewriter font` is used for material that you would type directly, and also for internal names of variables.

- Terms in italics are place-holders: you should substitute something specific, e.g. you might type `income` in place of the generic xvar.

- `The construction [` arg `]` means that the argument arg is optional: you may supply it or not (but in any case don't type the brackets).

- The phrase estimation command means a command that generates estimates for a given model, for example `ols`, `ar` or `wls`.

Section and Chapter references below are to Ramanathan (2002).

## gretl commands

&cmdlist;

## Estimators and tests: summary

shows the estimators available under the Model menu in gretl's main window. The corresponding script command (if there is one available) is shown in parentheses. For details consult the command's entry in .

### Estimators

Estimator | Comment
--- | ---
Ordinary Least Squares (`ols`) | The workhorse estimator
Weighted Least Squares (`wls`) | Heteroskedasticity, exclusion of selected observations
HCCM (`hccm`) | Heteroskedasticity corrected covariance matrix
Heteroskedasticity corrected (`hsk`) | Weighted Least Squares based on predicted error variance
Cochrane–Orcutt (`corc`) | First-order autocorrelation
Hildreth–Lu (`hilu`) | First-order autocorrelation
Prais–Winsten (`pwe`) | First-order autocorrelation
Autoregressive Estimation (`ar`) | Higher-order autocorrelation (generalized Cochrane–Orcutt)
ARMAX (`arma`) | Time-series model with ARMA error
GARCH (`garch`) | Generalized Autoregressive Conditional Heteroskedasticity
Vector Autoregression (`var`) | Systems of time-series equations
Cointegration test (`coint`) | Long-run relationships between series
Two-Stage Least Squares (`tsls`) | Simultaneous equations
Nonlinear Least Squares (`nls`) | Nonlinear models
Logit (`logit`) | Binary dependent variable (logistic distribution)
Probit (`probit`) | Binary dependent variable (normal distribution)
Tobit (`tobit`) | Truncated dependent variable
Logistic (`logistic`) | OLS, with logistic transformation of dependent variable
Least Absolute Deviation (`lad`) | Alternative to Least Squares
Rank Correlation (`spearman`) | Correlation with ordinal data
Pooled OLS (`pooled`) | OLS estimation for pooled cross-section, time series data
Multiple precision OLS (`mpols`) | OLS estimation using multiple precision arithmetic

shows the tests that are available under the Tests menu in a model window, after estimation.

### Tests for models

Test | Corresponding command
--- | ---
Omit variables (F-test if OLS) | `omit`
Add variables (F-test if OLS) | `add`
Sum of coefficients (t-test if OLS) | `coeffsum`
Nonlinearity (squares) | `lmtest --squares`
Nonlinearity (logs) | `lmtest --logs`
Nonlinearity (Ramsey's RESET) | `reset`
Heteroskedasticity (White's test) | `lmtest --white`
Influential observations | `leverage`
Autocorrelation up to the data frequency | `lmtest --autocorr`
Chow (structural break) | `chow`
CUSUM (parameter stability) | `cusum`
ARCH (conditional heteroskedasticity) | `arch`
Normality of residual | `testuhat`
Panel diagnostics | `hausman`

shows the correspondence between the long-form option flags used in the command reference above and the short versions.

### Long- and short-form options

Command | Option | Effect | Short form
--- | --- | --- | ---
`arma` | `--x-12-arima` | estimate with X-12-ARIMA | `-x`
| `--verbose` | print iteration details | `-v`
`coint2` | `--verbose` | print details of VARs | `-v`
`eqnprint, tabprint` | `--complete` | complete TeX document | `-o`
`fcasterr` | `--plot` | show graph | `-o`
`gnuplot` | `--with-lines` | plot with lines | `-o`
| `--with-impulses` | plot with impulses | `-m`
| `--suppress-fitted` | don't show fitted line | `-s`
| `--dummy` | factor separation | `-z`
`import` | `--box1` | import BOX1 data | `-o`
`leverage` | `--save` | save values to dataset | `-s`
`lmtest` | `--logs` | non-linearity (logs) | `-l`
| `--squares` | non-linearity (squares) | `-s`
| `--white` | White's test (heteroskedasticity) | `-w`
| `--autocorr` | serial correlation | `-m`
`meantest` | `--unequal-vars` | assume unequal variances | `-o`
`leverage` | `--save` | save values to dataset | `-s`
`ols` | `--robust` | robust standard errors | `-r`
| `--vcv` | print covariance matrix | `-o`
| `--quiet` | don't print results | `-q`
`outfile` | `--write` | open file for writing | `-w`
| `--append` | append to existing file | `-a`
| `--close` | close file | `-c`
`panel` | `--time-series` | stacked time series | `-s`
| `--cross-section` | stacked cross-sections | `-c`
`pca` | `--save` | save useful eigenvectors | `-s`
| `--save-all` | save all eigenvectors | `-a`
`pergm` | `--bartlett` | use Bartlett lag window | `-o`
`plot` | `--one-scale` | don't scale variables | `-o`
`print` | `--byobs` | variables in columns | `-o`
| `--ten` | use 10 significant figures | `-t`
`smpl` | `--dummy` | restrict using dummy var | `-o`
| `--no-missing` | only complete observations | `-m`
| `--restrict` | use boolean criterion | `-r`
`spearman` | `--verbose` | print original, ranked data | `-o`
`square` | `--cross` | generate cross-products | `-o`
`store` | `--csv` | comma-separated values | `-c`
| `--traditional` | traditional ESL format | `-t`
| `--gnu-octave` | GNU Octave format | `-m`
| `--gnu-R` | GNU R format | `-r`
| `--gzipped` | gzip compression | `-z`
`var` | `--quiet` | don't print all results | `-q`
Model commands | `--vcv` | print covariance matrix | `-o`