You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I compare the output to the same test in Python permutation_test library, it seems that your PermutationTest outputs the most frequent mean rather than the two-tailed pvalue. The one-tailed p-values are similar to those from Python permutation_test.
SQL (BIGQUERY)
CREATE TEMPORARY FUNCTION permutation_test(sampleX ARRAY<FLOAT64>, sampleY ARRAY<FLOAT64>)
RETURNS FLOAT64
LANGUAGE js AS
"""
return permutationTest(sampleX, sampleY, "two_side", 5000); //simple-statistics.alternative.permutationTest(sampleX: Array<number>, sampleY: Array<number>, alternative: string, k: number): number of permutations)
"""
OPTIONS (
library="xxxx"
);
SELECT permutation_test([2., 5, 3, 6, 7, 2, 5], [20., 5, 13, 12, 7, 2, 2])
Two-sided P = 0.133
PYTHON
import permutation_test as p
var_control = [2, 5, 3, 6, 7, 2, 5]
var_treatment = [20, 5, 13, 12, 7, 2, 2]
p_value = p.permutationtest(
data = var_control,
ref_data=var_treatment,
n_combinations_max=5000)
Two-sided P = 0.0999
The text was updated successfully, but these errors were encountered:
When I compare the output to the same test in Python permutation_test library, it seems that your PermutationTest outputs the most frequent mean rather than the two-tailed pvalue. The one-tailed p-values are similar to those from Python permutation_test.
SQL (BIGQUERY)
Two-sided P = 0.133
PYTHON
Two-sided P = 0.0999
The text was updated successfully, but these errors were encountered: