Learn more about the Alteryx Maveryx Universe recently announced at Inspire 2023!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Linear Regression, slope and intercept

mmongeon
8 - Asteroid

Hi,

 

Here's a macro I built for one of our business users.  

It takes a series of X and Y values as input, performs a least squares linear regression and returns the slope and intercept.

You also have the option of forcing the Intercept to 0, in which case, it will calculate and return the slope.

 

Hope it can be useful to others.

 

Enjoy!

3 REPLIES 3
BenMoss
ACE Emeritus
ACE Emeritus

I'm sure this will be useful!

Make sure you post it on the Alteryx Gallery (https://gallery.alteryx.com/#!), it's a central location for all things public macros/apps.

Ben

mmongeon
8 - Asteroid
Atabarezz
13 - Pulsar

great simple solution 🙂

 

though one may need a multivariate solution so do you have any idea why

we can't force intercept to 0 in linear regression tool?

 

Labels