tag:blogger.com,1999:blog-1275149608391671670.post2047976700149980031..comments2023-09-28T06:13:40.704-04:00Comments on SAS and R: Example 2014.9: Rolling averages. Also: Second Edition is shipping!Ken Kleinmanhttp://www.blogger.com/profile/09525118721291529157noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-1275149608391671670.post-18204311264092261402014-08-13T10:10:50.284-04:002014-08-13T10:10:50.284-04:00Quick suggestion for the R part -- in the lag func...Quick suggestion for the R part -- in the lag function, the "length(x)-k" should probably be in parentheses -- otherwise it first creates a vector of 1:length(x), and then subtracts k from each element (which is not what we want)Anonymousnoreply@blogger.com