Help us shape the future of Go! Take the 2026 Go Developer Survey

stats

package
v0.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package stats provides aggregate functions for statistics.

Provided functions:

  • var_pop: population variance
  • var_samp: sample variance
  • stddev_pop: population standard deviation
  • stddev_samp: sample standard deviation
  • skewness_pop: Pearson population skewness
  • skewness_samp: Pearson sample skewness
  • kurtosis_pop: Fisher population excess kurtosis
  • kurtosis_samp: Fisher sample excess kurtosis
  • covar_pop: population covariance
  • covar_samp: sample covariance
  • corr: Pearson correlation coefficient
  • regr_r2: correlation coefficient squared
  • regr_avgx: average of the independent variable
  • regr_avgy: average of the dependent variable
  • regr_sxx: sum of the squares of the independent variable
  • regr_syy: sum of the squares of the dependent variable
  • regr_sxy: sum of the products of each pair of variables
  • regr_count: count non-null pairs of variables
  • regr_slope: slope of the least-squares-fit linear equation
  • regr_intercept: y-intercept of the least-squares-fit linear equation
  • regr_json: all regr stats as a JSON object
  • percentile_disc: discrete quantile
  • percentile_cont: continuous quantile
  • percentile: continuous percentile
  • median: middle value
  • mode: most frequent value
  • every: boolean and
  • some: boolean or
  • bit_and: bitwise and
  • bit_or: bitwise or
  • bit_xor: bitwise xor

These join the Built-in Aggregate Functions:

  • count: count rows/values
  • sum: sum values
  • avg: average value
  • min: minimum value
  • max: maximum value

And the Built-in Window Functions:

  • rank: rank of the current row with gaps
  • dense_rank: rank of the current row without gaps
  • percent_rank: relative rank of the row
  • cume_dist: cumulative distribution

See: ANSI SQL Aggregate Functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(db *sqlite3.Conn) error

Register registers statistics functions.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL