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 for whatever you have in mind.

I think I read on one of these lists that the similar implementations in the
caTools package are even slightly faster, but I have less familiarity with
them.

Michael Weylandt

On Fri, Jul 29, 2011 at 9:21 PM, David Winsemius <dwinsem...@comcast.net>wrote:

>
> 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 the "running slope"?
>
> --
>
> David Winsemius, MD
> West Hartford, CT
>
>
> ______________________________**________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
> PLEASE do read the posting guide http://www.R-project.org/**
> posting-guide.html <http://www.R-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to