Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
Anyone created "Polynomial Regression Trend" in Qlik sense.
Please share the knowledge/set expression anything on same.
Thanks,
Aarti
Hi Aarti,
Yes, you can create a Polynomial Regression Trend in Qlik Sense. Here’s a basic outline of how to do it:
1. Prepare Your Data: Ensure your dataset includes the variables for which you want to establish the polynomial regression.
2. Load the Data: Load your data into Qlik Sense.
3. Create a Scatter Plot: Create a scatter plot to visualize the relationship between your variables.
4. Add Polynomial Trend Line:
• Go to the scatter plot properties.
• Navigate to Data, to your measure properties and select “Trend Lines.”
• Choose “Polynomial” and set the degree of the polynomial (e.g., 2 for quadratic, 3 for cubic).
5. Set Expression for Polynomial Regression: If you need more control, you might want to set your own expressions. Here’s an example for a quadratic polynomial regression (second-degree polynomial):
y = a + bx + cx^2
5. You can use the LINEST_M and LINEST_B functions in Qlik to calculate the coefficients a, b, and c.
Here’s a simple script to calculate these coefficients:
// Example of data load script
LOAD
YourXField,
YourYField
FROM [YourDataSource];
// Calculation of coefficients
LET vA = LINEST_B(YourYField, YourXField, 2);
LET vB = LINEST_M(YourYField, YourXField, 1);
LET vC = LINEST_M(YourYField, YourXField, 2);
// Create polynomial expression
SET vPolyExpression = $(vA) + $(vB) * YourXField + $(vC) * YourXField^2;
Thank you so much for the detailed answer @igoralcantara Yes this works 👍
Hi @igoralcantara, I think you can help on this.
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com
Hi Aarti,
Yes, you can create a Polynomial Regression Trend in Qlik Sense. Here’s a basic outline of how to do it:
1. Prepare Your Data: Ensure your dataset includes the variables for which you want to establish the polynomial regression.
2. Load the Data: Load your data into Qlik Sense.
3. Create a Scatter Plot: Create a scatter plot to visualize the relationship between your variables.
4. Add Polynomial Trend Line:
• Go to the scatter plot properties.
• Navigate to Data, to your measure properties and select “Trend Lines.”
• Choose “Polynomial” and set the degree of the polynomial (e.g., 2 for quadratic, 3 for cubic).
5. Set Expression for Polynomial Regression: If you need more control, you might want to set your own expressions. Here’s an example for a quadratic polynomial regression (second-degree polynomial):
y = a + bx + cx^2
5. You can use the LINEST_M and LINEST_B functions in Qlik to calculate the coefficients a, b, and c.
Here’s a simple script to calculate these coefficients:
// Example of data load script
LOAD
YourXField,
YourYField
FROM [YourDataSource];
// Calculation of coefficients
LET vA = LINEST_B(YourYField, YourXField, 2);
LET vB = LINEST_M(YourYField, YourXField, 1);
LET vC = LINEST_M(YourYField, YourXField, 2);
// Create polynomial expression
SET vPolyExpression = $(vA) + $(vB) * YourXField + $(vC) * YourXField^2;
Thank you so much for the detailed answer @igoralcantara Yes this works 👍