Find the AVERAGE of many SLOPE values

Reply
Regular Contributor
Posts: 212

Find the AVERAGE of many SLOPE values

[ Edited ]


I'm working with many simple linear regression outputs, particularly the 'slope' measures.

 

I'd like to AVERAGE various slope numbers.  The question is, how to best do this.

 

The underlying model is a 5-day time series.  Change each day.  Regression line through the five points.  Many runs at this.  So, each number below represents the slope from the regression line, over a five-day period.

 

Example:

 

Slope
6.43782
5.98223
2.12001
1.62409
0.60793
2.17274
5.76630
1.82939
4.09485
0.20365

 

Mean of Slope above = 3.0839

 

I read that it might be better to use the 'angle' version of slope for averaging (and clustering, etc.).

 

To convert from slope m to slope angle and back:
angle = arctan(m)
m = tan(angle)

 

 

Arctangent
1.41670
1.40517
1.13005
1.01889
0.54623
1.13945
1.39908
1.07054
1.33128
0.20090

 

Mean of Arctangent above = 1.06583

 

Converting back to Slope... Tangent(1.06583) = 1.80908
Totally different from 3.0839.

 

Anyone here care to comment? How to average slopes??

 

Thanks for your guidance.

 

Nicholas Kormanik

Super User
Posts: 1,228

Re: Find the AVERAGE of many SLOPE values

maybe you miss conversions of slope from degrees to radians, before computing the average,

and at last convert radians to degrees ?

 

Shmuel

Respected Advisor
Posts: 4,606

Re: Find the AVERAGE of many SLOPE values

Impossible to answer without context. What are the units of those slopes? Transforming slopes to angles can make sense, but only for unitless slopes. 

PG
Regular Contributor
Posts: 212

Re: Find the AVERAGE of many SLOPE values

Thanks.  I've added this information to the original question.

 

Does that help?

 

Respected Advisor
Posts: 4,606

Re: Find the AVERAGE of many SLOPE values

Yes, it does help. Obviously the X and Y units of your slopes are not the same. Here is why I asked about units.

 

Let's assume that the slopes are expressed in dollars per day. Suppose a colleague of yours wants to replicate your calculations, but that she prefers to express the amounts in yens per day. No problem, she multiplies everything by 113.62 (today's exchange rate). After arcTan - Mean - Tan operations, she gets an average slope of 121.04 yens per day. But your estimate of average slope is 1.809*113.62 = 205.54 yens per day!

 

I would avoid any estimator that is inconsistent in this way.

PG
SAS Super FREQ
Posts: 3,406

Re: Find the AVERAGE of many SLOPE values

As PGStats points out, the trick is to scale the data so that you can compare distances in the x and y directions.

This is usually accomplished by dividing the X data by the range(X) and the Y data by range(Y). 

 

There are many methods in the literature for computing average (or median) slopes, or for using the angles (often called orientations), for time series. You can read the article "Banking to 45: Aspect ratios for time series plots" for some of the ideas and formulas.  In general, you should not expect the orientation method to give the same answer as the slope method because arctan is a nonlinear transformation.

 

What question are you trying to answer with this analysis? Why do you want to compute the average slope or orientation?

Ask a Question
Discussion stats
  • 5 replies
  • 318 views
  • 4 likes
  • 4 in conversation