postgres.aggregates.RegrSXX

class RegrSXX(y, x) [source] Returns sum(x^2) - sum(x)^2/N (“sum of squares” of the independent variable) as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrSlope

class RegrSlope(y, x) [source] Returns the slope of the least-squares-fit linear equation determined by the (x, y) pairs as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrR2

class RegrR2(y, x) [source] Returns the square of the correlation coefficient as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrIntercept

class RegrIntercept(y, x) [source] Returns the y-intercept of the least-squares-fit linear equation determined by the (x, y) pairs as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrCount

class RegrCount(y, x) [source] Returns an int of the number of input rows in which both expressions are not null.

postgres.aggregates.RegrAvgY

class RegrAvgY(y, x) [source] Returns the average of the dependent variable (sum(y)/N) as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrAvgX

class RegrAvgX(y, x) [source] Returns the average of the independent variable (sum(x)/N) as a float, or None if there aren’t any matching rows.

postgres.aggregates.CovarPop.sample

sample By default CovarPop returns the general population covariance. However, if sample=True, the return value will be the sample population covariance.

postgres.aggregates.CovarPop

class CovarPop(y, x, sample=False) [source] Returns the population covariance as a float, or None if there aren’t any matching rows. Has one optional argument: sample By default CovarPop returns the general population covariance. However, if sample=True, the return value will be the sample population covariance.

postgres.aggregates.Corr

class Corr(y, x) [source] Returns the correlation coefficient as a float, or None if there aren’t any matching rows.