Compute deviations from the mean of the series.

Syntax: @demean(x[, s])

x: series, vector, matrix

s: (optional) sample string or object when x is a series and assigning result to a series

Return: series, vector, matrix

Returns a copy of x after subtracting off the mean.

For series calculations, EViews will use the current or specified workfile sample.

This function is panel aware.

Examples

The code below produces a graph of a series and its demeaned form:

wfcreate m 2000 2020

series y = 10 + nrnd

group g y @demean(y)

g.line

The first line creates a monthly workfile starting in January 2000 and ending in December 2020. The second line generates a series y equal to 10 plus normal error. The last two lines graphs y and @demean(y) together.

Cross-references