Calculated Metric using linear regression slope

Avatar

Avatar
Validate 50
Level 7
marion33678522
Level 7

Likes

167 likes

Total Posts

170 posts

Correct reply

5 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Boost 50
View profile

Avatar
Validate 50
Level 7
marion33678522
Level 7

Likes

167 likes

Total Posts

170 posts

Correct reply

5 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Boost 50
View profile
marion33678522
Level 7

16-10-2017

Hello Adobe Community,

I've been frantically trying to get the slope of a trended metric ( any metric over time ).

So I tried to use the Linear regression slope function on the calculated metric builder, since this function gives you the slope of this :

Y = a.X + b,

for any given X and Y metric ( and "a" the slope and "b" a constant)

My problem here is that trended metrics have more of a form like this :

Y(t) = a.t+b
(with t the time)


So I don't know what metric I need to put in here ( the metric builder needs 2 metrics, X and Y ).

My last solution is do it myself after extracting the CSV, which is fine with me, but I still wanted to know how to use all this functions !


The doc on the internet is quite empty on this subject, more input on this - and maybe the other functions -* would be really SWEET !

Kind regards,

Mario

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 1
Employee
ivan-andres
Employee

Like

1 like

Total Posts

5 posts

Correct reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 1
Employee
ivan-andres
Employee

Like

1 like

Total Posts

5 posts

Correct reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile
ivan-andres
Employee

20-03-2018

Unfortunately, it's not really meant to work with time as the independent variable.  It's for comparing two metrics, and time isn't a metric.  That said, I think you can get what you want by using the cumulative function.  It will only work if the dimension of your report is time, because it's not really time based, but rather "row number" based.

The idea is that we set a 1 on every row in the results, and then use cumulative to turn that into 1, 2, 3, ...  Then that is used as the independent variable, and you can use visits (or any other metric) as the dependent variable.  I have included a screen shot of the formula that I used as well as the exact same calculations in Excel.  That way, you can see if it's going to work for your use case.

Screen Shot 2018-03-20 at 2.28.15 PM.png

Answers (4)

Answers (4)

Avatar

Avatar
Establish
Employee
hyderziaee
Employee

Likes

228 likes

Total Posts

465 posts

Correct reply

222 solutions
Top badges earned
Establish
Coach
Contributor
Shape 1
Give Back 25
View profile

Avatar
Establish
Employee
hyderziaee
Employee

Likes

228 likes

Total Posts

465 posts

Correct reply

222 solutions
Top badges earned
Establish
Coach
Contributor
Shape 1
Give Back 25
View profile
hyderziaee
Employee

20-12-2017

I think I understood the part about time difference. I may have to test further.

Avatar

Avatar
Boost 3
Employee
BrandonKern-6Rh
Employee

Likes

4 likes

Total Posts

25 posts

Correct reply

3 solutions
Top badges earned
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 3
Employee
BrandonKern-6Rh
Employee

Likes

4 likes

Total Posts

25 posts

Correct reply

3 solutions
Top badges earned
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
BrandonKern-6Rh
Employee

24-03-2018

Mario

see my reply to your other forum post on linear regression.

Avatar

Avatar
Validate 50
Level 7
marion33678522
Level 7

Likes

167 likes

Total Posts

170 posts

Correct reply

5 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Boost 50
View profile

Avatar
Validate 50
Level 7
marion33678522
Level 7

Likes

167 likes

Total Posts

170 posts

Correct reply

5 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Boost 50
View profile
marion33678522
Level 7

22-01-2018

Helo hyderziaee​ ,

I'm sorry for not elaborating since last time I posted this topic.

What I wanted to do was a linear regression of visits over time. But I can't manage to o this with just the metric visits.

Kind regards ,

and cheers to the Adobe community ,

Mario

Avatar

Avatar
Establish
Employee
hyderziaee
Employee

Likes

228 likes

Total Posts

465 posts

Correct reply

222 solutions
Top badges earned
Establish
Coach
Contributor
Shape 1
Give Back 25
View profile

Avatar
Establish
Employee
hyderziaee
Employee

Likes

228 likes

Total Posts

465 posts

Correct reply

222 solutions
Top badges earned
Establish
Coach
Contributor
Shape 1
Give Back 25
View profile
hyderziaee
Employee

20-12-2017

can you elaborate what kind of slope are you looking for? or more specifically, how would the data look like in your result set?

In your formula, Y(t) = a.t + b

Consider:

Y = visits

t = month

a & b are constant numbers

what does a.(month) mean?

Also the slope formula for linear regression (line) is (Y2 - Y1) / (X2 - X1)

If I consider 't' as suppose '2017-01-01', what would you want (t2 - t1) to be?

If you can elaborate a bit, it might help understand if this the right way to do it, and if there is a workaround.

-Hyder