[R] Yet another help needed

From: Guojun Zhu <shmilylemon_at_yahoo.com>
Date: Mon 01 May 2006 - 12:31:35 EST


I have a big data.frame with abou 20 column and 60,000 rows for analyze. Let us say I had a column "a". I want to generate a new column which value should be the average of the 60 a before the current column. Let us say very row is time t_i. I need to calculate a(t_(i-60))+a(t(i-59)+...+a(t(i-1)). Also I want to get another number by run regression of
a(t(i-60)),..., a(t(i-1)) on b(t(i-60)),...,b(t(i-1)).  Is there any simple densed code for this? Thanks.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon May 01 13:10:46 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 01 May 2006 - 14:09:52 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.