transformations:linearregression
Table of Contents
LINEAR REGRESSION
Category: Transform / Math
Description
This action calculates the simple linear regression for a series of values.
Action settings
Setting | Description |
---|---|
Category | Select the category column. |
Series | Select the series column. |
Mode | Select the mode. Options: Linear trend (and enter a name for the new column) or Extra/interpolate empty values in series. |
Add columns… | Select additional columns to add to the dataset. Options: Add column with the alpha-coefficient (y-intercept) and Add column with the beta-coefficient (slope). |
Group by selected columns | When selected, choose the columns from the list to group the results by. |
Remarks
The output of this action can be used to create the regression line in a chart. (The chart below is sourced from the After table in the Example, below.)
Examples
Example #1
Generate the simple linear regression for the following income statement.
Before (source table)
Date | Income |
---|---|
01-Feb-2025 | 21.53 |
02-Feb-2025 | 17.99 |
03-Feb-2025 | 23.89 |
04-Feb-2025 | 24.49 |
05-Feb-2025 | 39.98 |
06-Feb-2025 | 24.74 |
After (result table)
Date | Income | Regression |
---|---|---|
01-Feb-2025 | 21.53 | 19.535 |
02-Feb-2025 | 17.99 | 21.896 |
03-Feb-2025 | 23.89 | 24.256 |
04-Feb-2025 | 24.49 | 26.617 |
05-Feb-2025 | 39.98 | 28.978 |
06-Feb-2025 | 24.74 | 31.338 |
Regression values rounded for brevity.
Action parameters
Category: Date
Series: Income
Mode: Linear trend
New column name: Regression
transformations/linearregression.txt · Last modified: 2025/02/27 17:15 by craigt