Level 1

0% to

Level 2

Tip /

to gain points, level up, and earn exciting badges like the new
Mission!

View all

## Calculated Metric using linear regression slope

marion33678522
Level 7

Likes

167 likes

Total Posts

170 posts

5 solutions
View profile

marion33678522
Level 7

Likes

167 likes

Total Posts

170 posts

5 solutions
View profile
marion33678522
Level 7

16-10-2017

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)

ivan-andres
Employee

Like

1 like

Total Posts

5 posts

4 solutions
View profile

ivan-andres
Employee

Like

1 like

Total Posts

5 posts

4 solutions
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.

hyderziaee
Employee

Likes

228 likes

Total Posts

465 posts

222 solutions
View profile

hyderziaee
Employee

Likes

228 likes

Total Posts

465 posts

222 solutions
View profile
hyderziaee
Employee

20-12-2017

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

BrandonKern-6Rh
Employee

Likes

4 likes

Total Posts

25 posts

3 solutions
View profile

BrandonKern-6Rh
Employee

Likes

4 likes

Total Posts

25 posts

3 solutions
View profile
BrandonKern-6Rh
Employee

24-03-2018

Mario

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

marion33678522
Level 7

Likes

167 likes

Total Posts

170 posts

5 solutions
View profile

marion33678522
Level 7

Likes

167 likes

Total Posts

170 posts

5 solutions
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

hyderziaee
Employee

Likes

228 likes

Total Posts

465 posts

222 solutions
View profile

hyderziaee
Employee

Likes

228 likes

Total Posts

465 posts

222 solutions
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