mean function in the Factory
The mean function displays the average attribute value calculated mathematically. It is the sum of the values divided by the number of values. (E.g.: the mean between 2; 3; 10 is 5).
This function doesn’t work with nominal attributes. For nominal attributes you can use the mode function.
The mean is available also by:
Selecting the column in the Data Manager and finding the mean in the Info panel.
Dragging the attribute in the Apply area of the Data Manager’s query panel.
Selecting the function in the Sheets tab of the Data Manager.
Function and parameters Parameter Description column It identifies the column to which you want to apply the formula. The column parameter is mandatory. group It allows you to group the results by a certain column. Example The following example uses the Students Performance dataset. Description Screenshot In the example here, we want to retrieve the mean of the math score attribute. We write the following formula: So, the mean of the math score attribute is 66.089. We also want to group our results by the test preparation course attribute, so the formula will become: The results are as follows: The mean of the math score of those who have done no test preparation course (none) is 64.078. The mean of the math score of those who have completed the test preparation course is 69.696.mean(column, group)
mean($"math score")
mean($"math score",$"test preparation course")