Hello:
You can't really generate a lag variable by itself. Think of it as
generating two new variables, i.e. unrate2, unrate2.lag.
unrate2 would just be data.approval$unrate with the first element removed
(i.e. unrate2 <- data.approval$unrate[2:(length(data.approval$unrate))] )
and unrate2.lag would be data.approval$unrate with the last element
removed ... or vice versa ... maybe I'm getting mixed up, but you get the
idea I hope.
--Andrew
On Wed, 29 Oct 2003, Jason Lakin wrote:
hi zoe:
i suspect there are several ways to do this. However, our group used a for
loop to generate a new variable where each index in the new variable is i+1
of the old variable (you can add more to the index number to make the lag
longer). this is a pretty easy way to do it if you have mastered the for
loop. you lose a small number of values when you do this (but of course,
this is inevitable).
if this is not clear, let me know and i will clarify further.
jason
----- Original Message -----
From: "Zoë VanderWolk" <vanderw(a)fas.harvard.edu>
To: <gov1000-list(a)fas.harvard.edu>
Sent: Wednesday, October 29, 2003 9:16 PM
Subject: [gov1000-list] index numbers
So for 3.c)...does anyone know an easy way of
generating our own lags?
(producing a new lag variable)
Zoe
_______________________________________________
gov1000-list mailing list
gov1000-list(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov1000-list
_______________________________________________
gov1000-list mailing list
gov1000-list(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov1000-list