Missing data values

These are represented internally as −999. In a native-format data file they should be represented as NA. When importing CSV data gretl accepts any of three representations of missing values: −999, the string NA, or simply a blank cell. Blank cells should, of course, be properly delimited, e.g. 120.6,,5.38, in which the middle value is presumed missing.

As for handling of missing values in the course of statistical analysis, gretl does the following:

Missing values in the middle of a dataset are a problem. In a cross-sectional dataset it may be possible to move the offending observations to the beginning or the end of the file, but obviously this won't do with time series data. For those who know what they are doing (!), the misszero function is provided under the genr command. By doing

genr foo = misszero(bar)

you can produce a series foo which is identical to bar except that any −999 values become zeros. Then you can use carefully constructed dummy variables to, in effect, drop the missing observations from the regression while retaining the surrounding sample range.[1]

Notes

[1]

genr also offers the inverse function to misszero, namely zeromiss, which replaces zeros in a given series with the missing observation code.