Search code examples
postgresqlstatisticsplpgsqlskewkurtosis

plpgsql Postgresql functions for calculating skewness and kurtosis


I was searching for Postgresql plpgsql functions to calculate "skewness" and "kurtosis" descriptive statistics functions, but I could not find any. It would be great if someone can share such plpgsql functions here. Thanks!


Solution

  • There is a plpgsql function doing what I need, on github: https://github.com/ellisonch/PostgreSQL-Stats-Aggregate/blob/master/pg_stats_aggregate.sql

    Now I need equivalent of Excel's NORMSINV function as well :-)