Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: lagged summary statistics

From   Kit Baum <>
Subject   st: lagged summary statistics
Date   Fri, 27 Oct 2006 19:58:58 -0400

Shihe said

Does any one has a routine for lagged summary statistics of a time
series and would not mind to share? The "mvsumm" and "rolling" seem only
capable of calculating the not lagged statistics (Maybe I was wrong).

Maybe I'm missing something, but...

. webuse wpi1

. mvsumm wpi,gen(avgwpi) stat(mean) window(4) end

. gen lag4qtravg = L.avgwpi
(4 missing values generated)

would seem to create the lagged moving average of the variable.

Kit Baum, Boston College Economics
An Introduction to Modern Econometrics Using Stata:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index