Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Computing slope of changing data

Jarrett Phillips:

In R, I have a dataset of (x, y) points that is constantly being updated via simulation (values are appended to the end of the dataset).

I would like to compute the Slope (via a linear model) of the line created by the data using only the last 10 listed datapoints.

The confusion here arises from the fact that the data are Changing, and so I suspect a loop may be needed to iterate over the indices of the datapoints.

In R, one usually does something like


linreg summary.linreg beta0

The change that is needed in my case is in linreg, specifically


linreg

For a non-changing dataset of 10 x-y points, one simply does [?] = [1:10] and the problem is Solved. In my case though, I am at a standstill as to the best way to proceed efficiently.

Any thoughts?



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Computing slope of changing data

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×