The pearson function returns the Pearson coefficient between column1 and column2, evaluated within groups defined by the group parameter if required.
The pearson coefficient represents the relationship between two continuous variables.
The Pearson coefficient ranges from -1 to +1, where:
-1 represents a negative correlation, and
+1 represents a positive correlation.
Function and parameters
pearson(column1, column2, group)
It identifies the first column to which you want to apply the formula. The column1 parameter is mandatory.
It identifies the second column to which you want to apply the formula. The column2 parameter is mandatory.
It allows you to group the results by a certain column.
The following example uses the Bike Sales dataset.
The value of the Pearson coefficient is 0.902, so the result is considered positive.