Skip to content

Commit

Permalink
wilkoxon cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasalmeida committed Oct 10, 2023
1 parent 293f089 commit 22303e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions export.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ console.log(`${location.href}export.js imported`)

const hello=`hello GPT at ${Date()}`;
import showdown from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm' // markdown>html
//import wilcoxon from 'https://cdn.jsdelivr.net/gh/stdlib-js/stats-wilcoxon@esm/index.mjs';

var key = null //'null'
var models = null
Expand Down
15 changes: 10 additions & 5 deletions functions/testFunctions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// https://platform.openai.com/docs/api-reference/chat/create#chat/create-functions
// https://openai.com/blog/function-calling-and-other-api-updates

import wilcoxon from 'https://cdn.jsdelivr.net/gh/stdlib-js/stats-wilcoxon@esm/index.mjs';

const loaded=Date()

async function weather_nci(when){
Expand Down Expand Up @@ -78,13 +80,16 @@ const fetchUCSC = { // at NCI Shady Grove
async function rankSumTest(parms){
// lets do t-test to warm things up
parms=parms||{
population1:[1,3,2,4,1,2,3,2,5,3],
population2:[3,4,5,3,4,2,3,5,4,6,7,4]
population1:[1.83, 0.5, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.3],
population2:[0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29]
}
// get simple-statistics library
let st=await import('https://esm.sh/[email protected]')
let z = st.tTestTwoSample(parms.population1,parms.population2)
return `the comparison of population [${parms.population1}] with [${parms.population2}] by a rank sum test assigns a p = ${st.cumulativeStdNormalProbability(z)} to the null hypothesis that they are similar`
// let st=await import('https://esm.sh/[email protected]')
// let z = st.tTestTwoSample(parms.population1,parms.population2)
// return `the comparison of population [${parms.population1}] with [${parms.population2}] by a rank sum test assigns a p = ${st.cumulativeStdNormalProbability(z)} to the null hypothesis that they are similar`
let wcTest = wilcoxon(parms.population1,parms.population2)
wcTest.pValue
return `the comparison of population [${parms.population1}] with [${parms.population2}] by a rank sum test assigns a p = ${wcTest.pValue} to the null hypothesis that they are similar`
}

const rankSumTestDescription = { // at NCI Shady Grove
Expand Down

0 comments on commit 22303e0

Please sign in to comment.