Skip to content

combineMeans

combineMeans(mean1, n1, mean2, n2): number

Defined in: src/combine_means.js:18

When combining two lists of values for which one already knows the means, one does not have to necessary recompute the mean of the combined lists in linear time. They can instead use this function to compute the combined mean by providing the mean & number of values of the first list and the mean & number of values of the second list.

number

mean of the first list

number

number of items in the first list

number

mean of the second list

number

number of items in the second list

number

the combined mean

3.0.0

combineMeans(5, 3, 4, 3); // => 4.5