JavaScript How do I run a paired t-test in BigQuery. Are there any UDFs available?

I am attempting to run a paired t-test in bigquery using the JavaScript statistical.js library and I am getting inconsistent numbers.

My code is as follows;

 CREATE TEMPORARY FUNCTION ttest(a ARRAY<FLOAT64>, b ARRAY<FLOAT64>)
 RETURNS FLOAT64
 LANGUAGE js AS
"""
   return statistical.methods.tTestTwoSample(a, b); 
   //statistical.methods.tTestTwoSample(sample1: Array, sample2: Array) 
"""
OPTIONS (
library="gs://my_bucket/statistical.js"
);


SELECT 
 ttest([9.96,   3.76,   1.17,   8.66,   5.25,   7.61,   5.8,    1.84,   7.06, 9.4,  2.99,   9.3,    9.01,   4.24,   3.52,   9.6,    7.59,   6.99,   9.62,   2.18] , 
    [3.96,  5.76,   7.17,   7.66,   9.25,   3.61,   4.8,    8.84,   6.06,   4.4,    1.99,   8.3,    9.01,   1.24,   5.52,   8.6,    5.59,   1.99,   7.62,   3.18]  ) ttest 

With gs://my_bucket/statistical.js as the location of where the JS package is saved in google storage.

The package is available here https://github.com/adrien2p/statistical-js

The two sample t-test statistical.methods.tTestTwoSample(sample1: Array, sample2: Array) should return a p-value. I was unable to find out if the test was paired or otherwise. When I run the code I get 4.099, which as far as I know is not a p-value. I have ran the test in Excel to validate the result using =T.TEST() and I get a p-value of 0.4871 on a paired two sided test. I have also attempted other t-tests other than paired and attempted treating the 4.099 result as a T-Statistic without any luck of the numbers matching.

So my question is, how can I run a paired t-test in BigQuery with a resulting p-value? Should I be using other packages?

Thanks in advance for any help.

Answer:1

When adding elements via pure js on Vue Single File Component, the added elements don't have v-id-xx attribute for scoped css. How can I get THE component's v-id-hash value by pure js?

When adding elements via pure js on Vue Single File Component, the added elements don't have v-id-xx attribute for scoped css. How can I get THE component's v-id-hash value by pure js?

How to access a nested property, in a safe way (i.e. without throwing a TypeError) (a.b) ? a.b.c : undefined Is there a less verbose way, without using a framework ?

How to access a nested property, in a safe way (i.e. without throwing a TypeError) (a.b) ? a.b.c : undefined Is there a less verbose way, without using a framework ?

  1. access nested property javascript
  2. javascript access nested property by string
  3. access nested object property javascript
  4. js access nested property by string
  5. lodash access nested property
  6. es6 access nested property
  7. javascript access nested property dynamically
  8. typescript access nested property
  9. access nested json property javascript
  10. access nested json property
  11. js access nested property
  12. access nested object property js
  13. javascript safely access nested property
  14. javascript access nested object property with variable
  15. js access nested object property by string
  16. javascript access object nested property by string
  17. typescript access nested object property
  18. javascript access nested object property dynamically
  19. c# access nested class property
  20. php access nested object property

I have similar code like below and I want If I clicked in Child Div then Parent Div click event should not trigger. <div class="parentDiv" (click)="parentDiv()"> <div class="childDiv" (...

I have similar code like below and I want If I clicked in Child Div then Parent Div click event should not trigger. <div class="parentDiv" (click)="parentDiv()"> <div class="childDiv" (...

I have the following code: Html <div ng-controller="MyCtrl"> {{message}}! <button ng-click="changeMessage()">change Message</button> </div> AngularJs var myApp = ...

I have the following code: Html <div ng-controller="MyCtrl"> {{message}}! <button ng-click="changeMessage()">change Message</button> </div> AngularJs var myApp = ...

  1. angularjs uncaught referenceerror require is not defined
  2. angularjs uncaught referenceerror is not defined
  3. angularjs uncaught referenceerror angular is not defined
  4. angularjs uncaught referenceerror exports is not defined
  5. angularjs uncaught referenceerror $filter is not defined
  6. angularjs uncaught referenceerror moment is not defined