Skip to content

Hypothesis Tests functions in the Stochastic DuckDB extension

Function category

Hypothesis Tests

31 functions

chi_squared_test

Aggregate function Hypothesis Tests
Signature
chi_squared_test(observed: DOUBLE, expected: DOUBLE) → STRUCT(statistic DOUBLE, degrees_of_freedom DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument observed Type DOUBLE Mode Positional Description
Argument expected Type DOUBLE Mode Positional Description
Description
1 Goodness of fit of observed counts to expected proportions
SELECT chi_squared_test(observed, expected) AS result
FROM (VALUES (18, 0.2), (22, 0.2), (31, 0.3), (29, 0.3)) t(observed, expected);

Output

result
{'statistic': 0.4666666666666809, 'degrees_of_freedom': 3.0, 'p_value': 0.9261511402759961}

dist_arcsine_ks_test

Aggregate function Hypothesis Tests Arcsine
Signature
dist_arcsine_ks_test( x: DOUBLE, min: DOUBLE, max: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument min Type DOUBLE Mode Positional Description
Argument max Type DOUBLE Mode Positional Description
Description
1 Test a sample against a arcsine distribution
SELECT dist_arcsine_ks_test(x, 0.0, 1.0) AS ks
FROM (VALUES (0.12), (0.34), (0.27), (0.51), (0.18), (0.42), (0.09), (0.63), (0.31), (0.22)) t(x);

Output

ks
{'statistic': 0.41627743252839533, 'p_value': 0.06249796055213297}

dist_beta_ks_test

Aggregate function Hypothesis Tests Beta
Signature
dist_beta_ks_test( x: DOUBLE, alpha: DOUBLE, beta: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument alpha Type DOUBLE Mode Positional Description
Argument beta Type DOUBLE Mode Positional Description
Description
1 Test a sample against a beta distribution
SELECT dist_beta_ks_test(x, 2.0, 5.0) AS ks
FROM (VALUES (0.12), (0.34), (0.27), (0.51), (0.18), (0.42), (0.09), (0.63), (0.31), (0.22)) t(x);

Output

ks
{'statistic': 0.11282817564500014, 'p_value': 0.9995656237430521}

dist_cauchy_ks_test

Aggregate function Hypothesis Tests Cauchy
Signature
dist_cauchy_ks_test( x: DOUBLE, location: DOUBLE, scale: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument location Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a cauchy distribution
SELECT dist_cauchy_ks_test(x, 0.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.6211189415908434, 'p_value': 0.0008914799495648358}

dist_chi_squared_ks_test

Aggregate function Hypothesis Tests Chi-squared
Signature
dist_chi_squared_ks_test(x: DOUBLE, degrees_of_freedom: DOUBLE) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument degrees_of_freedom Type DOUBLE Mode Positional Description
Description
1 Test a sample against a chi squared distribution
SELECT dist_chi_squared_ks_test(x, 5.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.520835969214496, 'p_value': 0.008806589407778226}

dist_exponential_ks_test

Aggregate function Hypothesis Tests Exponential
Signature
dist_exponential_ks_test(x: DOUBLE, rate: DOUBLE) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument rate Type DOUBLE Mode Positional Description
Description
1 Test waiting times against an exponential with rate 2
SELECT round(dist_exponential_ks_test(x, 2.0).p_value, 4) AS p_value
FROM (VALUES (0.1), (0.6), (0.3), (0.05), (1.2), (0.4), (0.2), (0.9)) t(x);

Output

p_value
1.0

dist_extreme_value_ks_test

Aggregate function Hypothesis Tests Extreme Value
Signature
dist_extreme_value_ks_test( x: DOUBLE, location: DOUBLE, scale: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument location Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a extreme value distribution
SELECT dist_extreme_value_ks_test(x, 0.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.5115448336890416, 'p_value': 0.010668974715049323}

dist_fisher_f_ks_test

Aggregate function Hypothesis Tests Fisher F
Signature
dist_fisher_f_ks_test( x: DOUBLE, d1: DOUBLE, d2: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument d1 Type DOUBLE Mode Positional Description
Argument d2 Type DOUBLE Mode Positional Description
Description
1 Test a sample against a fisher f distribution
SELECT dist_fisher_f_ks_test(x, 5.0, 10.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.29944732219125836, 'p_value': 0.3312625185242358}

dist_gamma_ks_test

Aggregate function Hypothesis Tests Gamma
Signature
dist_gamma_ks_test( x: DOUBLE, shape: DOUBLE, scale: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument shape Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a gamma distribution
SELECT dist_gamma_ks_test(x, 2.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.16262726620684465, 'p_value': 0.9540753041927538}

dist_inverse_chi_squared_ks_test

Aggregate function Hypothesis Tests Inverse Chi-squared
Signature
dist_inverse_chi_squared_ks_test( x: DOUBLE, degrees_of_freedom: DOUBLE, scale: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument degrees_of_freedom Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a inverse chi squared distribution
SELECT dist_inverse_chi_squared_ks_test(x, 5.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.23419937333858387, 'p_value': 0.6430017704099455}

dist_inverse_gamma_ks_test

Aggregate function Hypothesis Tests Inverse Gamma
Signature
dist_inverse_gamma_ks_test( x: DOUBLE, shape: DOUBLE, scale: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument shape Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a inverse gamma distribution
SELECT dist_inverse_gamma_ks_test(x, 3.0, 2.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.42574752602793237, 'p_value': 0.053285509526540493}

dist_inverse_gaussian_ks_test

Aggregate function Hypothesis Tests Inverse Gaussian
Signature
dist_inverse_gaussian_ks_test( x: DOUBLE, mean: DOUBLE, shape: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument mean Type DOUBLE Mode Positional Description
Argument shape Type DOUBLE Mode Positional Description
Description
1 Test a sample against a inverse gaussian distribution
SELECT dist_inverse_gaussian_ks_test(x, 1.0, 2.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.3868029276988658, 'p_value': 0.10032812573201799}

dist_kolmogorov_smirnov_ks_test

Aggregate function Hypothesis Tests Kolmogorov-Smirnov
Signature
dist_kolmogorov_smirnov_ks_test(x: DOUBLE, sample_size: DOUBLE) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument sample_size Type DOUBLE Mode Positional Description
Description
1 Test a sample against a kolmogorov smirnov distribution
SELECT dist_kolmogorov_smirnov_ks_test(x, 10.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.9184811135877904, 'p_value': 9.409095277317957e-08}

dist_laplace_ks_test

Aggregate function Hypothesis Tests Laplace
Signature
dist_laplace_ks_test( x: DOUBLE, location: DOUBLE, scale: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument location Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a laplace distribution
SELECT dist_laplace_ks_test(x, 0.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.6648399769821803, 'p_value': 0.00028957485747974884}

dist_logistic_ks_test

Aggregate function Hypothesis Tests Logistic
Signature
dist_logistic_ks_test( x: DOUBLE, location: DOUBLE, scale: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument location Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a logistic distribution
SELECT dist_logistic_ks_test(x, 0.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.598687660112452, 'p_value': 0.001540896163719463}

dist_lognormal_ks_test

Aggregate function Hypothesis Tests Log-normal
Signature
dist_lognormal_ks_test( x: DOUBLE, mean: DOUBLE, stddev: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument mean Type DOUBLE Mode Positional Description
Argument stddev Type DOUBLE Mode Positional Description
Description
1 Test a sample against a lognormal distribution
SELECT dist_lognormal_ks_test(x, 0.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.2606675826226491, 'p_value': 0.5051542379945657}

dist_non_central_beta_ks_test

Aggregate function Hypothesis Tests Non-central Beta
Signature
dist_non_central_beta_ks_test( x: DOUBLE, alpha: DOUBLE, beta: DOUBLE, noncentrality: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument alpha Type DOUBLE Mode Positional Description
Argument beta Type DOUBLE Mode Positional Description
Argument noncentrality Type DOUBLE Mode Positional Description
Description
1 Test a sample against a non central beta distribution
SELECT dist_non_central_beta_ks_test(x, 2.0, 3.0, 1.0) AS ks
FROM (VALUES (0.12), (0.34), (0.27), (0.51), (0.18), (0.42), (0.09), (0.63), (0.31), (0.22)) t(x);

Output

ks
{'statistic': 0.3702747826015753, 'p_value': 0.12883938893595392}

dist_non_central_chi_squared_ks_test

Aggregate function Hypothesis Tests Non-central Chi-squared
Signature
dist_non_central_chi_squared_ks_test( x: DOUBLE, degrees_of_freedom: DOUBLE, noncentrality: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument degrees_of_freedom Type DOUBLE Mode Positional Description
Argument noncentrality Type DOUBLE Mode Positional Description
Description
1 Test a sample against a non central chi squared distribution
SELECT dist_non_central_chi_squared_ks_test(x, 4.0, 2.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.5808945177821523, 'p_value': 0.002344644150378174}

dist_non_central_f_ks_test

Aggregate function Hypothesis Tests Non-central F
Signature
dist_non_central_f_ks_test( x: DOUBLE, d1: DOUBLE, d2: DOUBLE, noncentrality: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument d1 Type DOUBLE Mode Positional Description
Argument d2 Type DOUBLE Mode Positional Description
Argument noncentrality Type DOUBLE Mode Positional Description
Description
1 Test a sample against a non central f distribution
SELECT dist_non_central_f_ks_test(x, 5.0, 10.0, 2.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.15463195317398948, 'p_value': 0.9705537878269356}

dist_non_central_t_ks_test

Aggregate function Hypothesis Tests Non-central t
Signature
dist_non_central_t_ks_test( x: DOUBLE, degrees_of_freedom: DOUBLE, noncentrality: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument degrees_of_freedom Type DOUBLE Mode Positional Description
Argument noncentrality Type DOUBLE Mode Positional Description
Description
1 Test a sample against a non central t distribution
SELECT dist_non_central_t_ks_test(x, 10.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.27688821529635366, 'p_value': 0.42729006642351897}

dist_normal_ks_test

Aggregate function Hypothesis Tests Normal
Signature
dist_normal_ks_test( x: DOUBLE, mean: DOUBLE, stddev: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument mean Type DOUBLE Mode Positional Description
Argument stddev Type DOUBLE Mode Positional Description
Description
1 Test whether values look standard normal
SELECT dist_normal_ks_test(x, 0.0, 1.0) AS ks
FROM (VALUES (-1.2), (0.3), (0.8), (-0.4), (1.9), (0.1), (-0.7), (0.5)) t(x);

Output

ks
{'statistic': 0.164827837277029, 'p_value': 0.9815767356290033}

dist_pareto_ks_test

Aggregate function Hypothesis Tests Pareto
Signature
dist_pareto_ks_test( x: DOUBLE, scale: DOUBLE, shape: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Argument shape Type DOUBLE Mode Positional Description
Description
1 Test a sample against a pareto distribution
SELECT dist_pareto_ks_test(x, 1.0, 3.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.3285322359396433, 'p_value': 0.23060187850681535}

dist_rayleigh_ks_test

Aggregate function Hypothesis Tests Rayleigh
Signature
dist_rayleigh_ks_test(x: DOUBLE, scale: DOUBLE) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a rayleigh distribution
SELECT dist_rayleigh_ks_test(x, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.3110783825406137, 'p_value': 0.2878656925455899}

dist_skew_normal_ks_test

Aggregate function Hypothesis Tests Skew Normal
Signature
dist_skew_normal_ks_test( x: DOUBLE, location: DOUBLE, scale: DOUBLE, shape: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument location Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Argument shape Type DOUBLE Mode Positional Description
Description
1 Test a sample against a skew normal distribution
SELECT dist_skew_normal_ks_test(x, 0.0, 1.0, 4.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.4318846771995842, 'p_value': 0.047961623466389075}

dist_students_t_ks_test

Aggregate function Hypothesis Tests Student's t
Signature
dist_students_t_ks_test(x: DOUBLE, degrees_of_freedom: DOUBLE) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument degrees_of_freedom Type DOUBLE Mode Positional Description
Description
1 Test a sample against a students t distribution
SELECT dist_students_t_ks_test(x, 10.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.6512162951704386, 'p_value': 0.0004144716085637138}

dist_triangular_ks_test

Aggregate function Hypothesis Tests Triangular
Signature
dist_triangular_ks_test( x: DOUBLE, lower: DOUBLE, mode: DOUBLE, upper: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument lower Type DOUBLE Mode Positional Description
Argument mode Type DOUBLE Mode Positional Description
Argument upper Type DOUBLE Mode Positional Description
Description
1 Test a sample against a triangular distribution
SELECT dist_triangular_ks_test(x, 0.0, 0.5, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.78, 'p_value': 1.0388066948005695e-05}

dist_uniform_real_ks_test

Aggregate function Hypothesis Tests Uniform (Real)
Signature
dist_uniform_real_ks_test( x: DOUBLE, min: DOUBLE, max: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument min Type DOUBLE Mode Positional Description
Argument max Type DOUBLE Mode Positional Description
Description
1 Test a sample against a uniform real distribution
SELECT dist_uniform_real_ks_test(x, 0.0, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.7, 'p_value': 0.00011090319886433517}

dist_weibull_ks_test

Aggregate function Hypothesis Tests Weibull
Signature
dist_weibull_ks_test( x: DOUBLE, shape: DOUBLE, scale: DOUBLE ) → STRUCT(statistic DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument shape Type DOUBLE Mode Positional Description
Argument scale Type DOUBLE Mode Positional Description
Description
1 Test a sample against a weibull distribution
SELECT dist_weibull_ks_test(x, 1.5, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);

Output

ks
{'statistic': 0.4106284978663306, 'p_value': 0.06861744510567767}

one_sample_t_test

Aggregate function Hypothesis Tests
Signature
one_sample_t_test(x: DOUBLE, mu: DOUBLE) → STRUCT(t_statistic DOUBLE, degrees_of_freedom DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument mu Type DOUBLE Mode Positional Description
Description
1 Test whether the mean equals 5
SELECT one_sample_t_test(x, 5.0) AS result
FROM (VALUES (5.1), (4.8), (5.6), (5.0), (5.4), (5.3)) t(x);

Output

result
{'t_statistic': 1.6903085094570263, 'degrees_of_freedom': 5.0, 'p_value': 0.15176111049909943}

student_t_test

Aggregate function Hypothesis Tests
Signature
student_t_test(x: DOUBLE, sample_index: BIGINT) → STRUCT(t_statistic DOUBLE, degrees_of_freedom DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument sample_index Type BIGINT Mode Positional Description
Description
1 Pooled-variance two-sample t-test
SELECT student_t_test(x, grp).p_value AS p_value
FROM (VALUES (5.1, 0), (4.8, 0), (5.6, 0), (5.0, 0), (6.2, 1), (5.9, 1), (7.1, 1), (6.4, 1)) t(x, grp);

Output

p_value
0.005947625666406391

welch_t_test

Aggregate function Hypothesis Tests
Signature
welch_t_test(x: DOUBLE, sample_index: BIGINT) → STRUCT(t_statistic DOUBLE, degrees_of_freedom DOUBLE, p_value DOUBLE)
Arguments (Positional)
Argument x Type DOUBLE Mode Positional Description
Argument sample_index Type BIGINT Mode Positional Description
Description
1 Compare two groups with unequal variances
SELECT welch_t_test(x, grp) AS result
FROM (VALUES (5.1, 0), (4.8, 0), (5.6, 0), (5.0, 0), (6.2, 1), (5.9, 1), (7.1, 1), (6.4, 1)) t(x, grp);

Output

result
{'t_statistic': -4.1595134458768355, 'degrees_of_freedom': 5.230386148373551, 'p_value': 0.008012385831038592}