Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Linear Regression Model


Hi All,


I'm doing an evaluation of Alteryx Designer for my company.  I need to build a linear regression model in Alteryx.  I have both qualitative and quantitative predictor variables.  I originally created the model using the statistical software Minitab.  I would like to be able to create a first-order main effects model, a first order interaction model, and a second order model.  I did try using the Linear Regression tool in my workflow, but it doesn't seem to have the options to add interactions, or higher-order terms.  The tool also didn't have an option to identify my qualitative predictors apart from my quantitative predictors, and didn't give me a least-squares regression equation.  


Any ideas?


Thank you!



Community Content Engineer
Community Content Engineer

Hi @Jennifer


It is certainly possible to create all of the components of your linear regression project in Alteryx. To create a first-order main effects model, you would simply run your data through the Linear Regression Tool. For the first order interaction model, you will simply need to create your interaction terms using a Formula Tool ([Field1]*[Field2]), and then plug those interaction terms into the Linear Regression Tool. The same concept applies to creating a second order model. You could first create the necessary variables using the Formula Tool by squaring each of your variables of interest (the pow() function will work nicely), and then push those variables into a third Linear Regression Tool. This way, you have total control over how each of your interaction and second order variables are created, and the corresponding models are generated. 




The Linear Regression tool automatically determines variable types based on the field data type, so it is important to make sure your categorical variables are string type (even if they are represented by numbers) and your continuous variables are a numeric data type. You can use a Select Tool to adjust any data types prior to generating a model using the Linear Regression Tool. 


If you are looking for the regression equation of the coefficients of the generated regression equation are included in the "R" output of the model. There is also an R programming language model object output in the "O" anchor. If you would like your coefficients put out as data, please check out the Model Coefficients Tool, available in the Predictive District of the Alteryx Analytics Gallery. Simply connect this tool to the "O" output anchor of your Linear Regression Tool, and you will get the coefficients of your equation to use in your data stream.




If you are instead referring to the method by which the linear regression is modeled, by default, the tool generates an ordinary least-squared regression (OLS). You can generate a weighted least squared regression by selecting the Use a weight variable for weighted least squares in the customize model panel, or a regularized regression by checking the Use regularized regression option. For more information on regularized regression in Alteryx, please see this Community Knowledge Base Article


Does this answer all of your questions on using the Linear Regression Tool? Are there any further questions I might be able to help you with? Please let me know!


Hi @SydneyF,


I'm sorry for the delayed reply.  Thank you SO MUCH for the detailed response.  All of the information you provided was extremely helpful!


Thanks again!