Re: [R] running slope

2011-07-29 Thread R. Michael Weylandt
Also, if it works for you and there are no data irregularities, might I suggest you look at making use of the runSD() and runCov or runCor functions of the TTR package. If you know the relationship between slope of an intercept -- beta = cov(x,y) / var(x) -- it should be pretty easy to implement fo

Re: [R] running slope

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 8:22 PM, Byerly, Mike M (DFG) wrote: Is there a function in R that will calculate a running linear slope similar to the way the function filter() will calculate a moving average? If you are happy with the return from filter, then why not take the first differences as th

[R] running slope

2011-07-29 Thread Byerly, Mike M (DFG)
Is there a function in R that will calculate a running linear slope similar to the way the function filter() will calculate a moving average? Mike Byerly Fisheries Biologist Commercial Fisheries Division Alaska Dept. of Fish and Game 3298 Douglas Place Homer, AK 99603 mike.bye...@alask