Solved

Distance from linear trend

Posted on 2014-07-31
2
147 Views
Last Modified: 2014-09-15
How do I calculate the distance from a linear trend in a line chart that goes up and down but steadily increasing?
0
Comment
Question by:fitaliano
2 Comments
 
LVL 93

Expert Comment

by:John Hurst
ID: 40233136
There are a number of ways, all under goodness of fit (which I forgot some decades back).

The simplest way (if the numbers are positive and you have a good regression line) is to calculate the y value on the line for the x value of the point.

The vertical distance between the line is y(line) - y(point).

That is one way and that is not the only way.
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40233427
Excel has a function - TREND - which will calculate the linear trend value for any given x-value, based on a set of existing x and y values.  Using this, one can calculate the delta (distance) between any given y-value in the set and the linear trend value for the same value of x.  Here's the syntax:

=TREND((known_y's, [known_x's], [new_x's], [const]), where

known_y's is the range containing the y-values
known_x's is the range containing the x-values (optional if x is understood to be 1,2,3,4...)
new_x's is the range containing the "new" x-values to use for calculating the given linear trend point
const is TRUE is forcing the formula to intercept at y=0

In your case, you'll use your existing data for all the x and y values, then use each individual value of x to produce the linear trend value.  From there you just substract that value from the original y-value to get the delta (distance).

See this example of how you'd do it:
TREND exampleNote the formula entered in cell C2 (and copied down)
=TREND($B$2:$B$11,$A$2:$A$11,A2,TRUE)

You can see from the chart and linear trend on it the the deltas agree with what's seen visually.  Example file attached.,

Regards,
-Glenn


Microsoft Reference: TREND function
EE-TrendExample.xlsx
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question