@msumsq |

Trailing moving sums of squares (ignore NAs).

n-period trailing moving sums of squares, ignoring NAs.

Syntax: @msumsq(x, n)

x: series

n integer, series

Return: series

For each observation and integer , compute the sums of squares () using the current and previous observations of the series,

and ignoring missing values (NAs).

If n is not an integer, the integer floor will be used.

Examples

show @msumsq(x, 12)

produces a linked series of the moving sum of squares of the series x where NAs are ignored.

Cross-references

See also
@msum.

For the NA-propagating variant of this function, see
@movsumsq.