Documentation
¶
Index ¶
- func Correlation(a []float64, b []float64) float64
- func Covariance(a []float64, b []float64) float64
- func InterQuartileRange(input []float64) float64
- func Max(input []float64) float64
- func Mean(input []float64) float64
- func Median(input []float64) (output float64)
- func Min(input []float64) float64
- func OneSampleTTest(sample []float64, popmean float64, alpha float64, tails TailDirection) (bool, float64)
- func OneSampleZTest(sample []float64, pop pd.Normal, alpha float64, tails TailDirection) (bool, float64)
- func PairedTTest(presample []float64, postsample []float64, alpha float64, tails TailDirection) (bool, float64, float64)
- func Quartile1(input []float64) (Q1 float64)
- func Quartile2(input []float64) float64
- func Quartile3(input []float64) (Q3 float64)
- func Range(input []float64) float64
- func StdDev(input []float64) float64
- func Variance(input []float64) float64
- type TailDirection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Correlation ¶
Correlation returns the correlation between two data samples
func Covariance ¶
Covariance returns the covariance between two data samples
func InterQuartileRange ¶
InterQuartileRange returns the difference between the third and the first quartiles.
func OneSampleTTest ¶
func OneSampleTTest(sample []float64, popmean float64, alpha float64, tails TailDirection) (bool, float64)
OneSampleTTest performs a One Sample T Test. This test can be performed when we don't know the populations std dev. It returns true if the null hypoyhesis is accepted and false otherwise. alpha is the significance level of one tail. Right tail : Null hypothesis Ho : sample mean <= pop mean. Alternative hypothesis H1 : sample mean > pop mean. Two tails : Null hypothesis Ho : sample mean = pop mean. Alternative hypothesis H1 : sample mean != pop mean. Left tail : Null hypothesis Ho : sample mean >= pop mean. Alternative hypothesis H1 : sample mean < pop mean.
func OneSampleZTest ¶
func OneSampleZTest(sample []float64, pop pd.Normal, alpha float64, tails TailDirection) (bool, float64)
OneSampleZTest performs a Z Test. Z is the Standard normal distribution N(0,1). This test can be performed when the population is normally distributed and the population variance is known. It returns true if the null hypothesis is accepted and false otherwise. alpha is the significance level of one tail. Right tail (1): Null hypothesis Ho : sample mean <= pop mean. Alternative hypothesis H1 : sample mean > pop mean. Two tails (2): Null hypothesis Ho : sample mean = pop mean. Alternative hypothesis H1 : sample mean != pop mean. Left tail (-1): Null hypothesis Ho : sample mean >= pop mean. Alternative hypothesis H1 : sample mean < pop mean.
func PairedTTest ¶
func PairedTTest(presample []float64, postsample []float64, alpha float64, tails TailDirection) (bool, float64, float64)
PairedTTest function returns the result of a Pared T Test
Types ¶
type TailDirection ¶
type TailDirection uint8
TailDirection represents the direction of the tails that you consider from a distribution to perform statistical tests.
const ( // TailRight represents the right tail of the distribution. TailRight TailDirection = iota // TailLeft represents the left tail of the distribution. TailLeft // TailBoth represents both left and right tails. TailBoth )