Skip to content

Commit

Permalink
Merge pull request #5 from YujiSODE/branchY31082016
Browse files Browse the repository at this point in the history
Branch y31082016
  • Loading branch information
YujiSODE authored Aug 30, 2016
2 parents 48eba12 + 6b0ba29 commit 3bf4ca5
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 8 deletions.
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
#Change Log

## [2.0] - 2016-08-31
##Changed
- [README.md]: updated README.md

##Added
- [subStatDist.js] line 52-53: ` lk=f('a','link'+r9,tDiv.id),lk.innerHTML='<br>Test with bootstrap method',lk.href='./testingFtU2.html';`

##Changed
- [subStatDist.js] line 20: `var B,tDiv,fm,fmR,lbA,ipA,lbB,ipB,Btn,TxtALb,txtA,br01,restB,adrsLbl,adrs,sbmtB,t,D=[],lk;`

## [2.0] - 2016-08-30
##Changed
- [statDist2.js] line 17-22 in statDist.js:` var c,d=e.data.split('@'),d0=d[0].split(','),d1=d[1].split(','),d2=+d[2],d3=+d[3],I=0,N=0,dBts,P=[],p,X=[0,0,0],pJn=[];`
` I=0,N=d1.length;while(I<N){d1[I]=+d1[I],I+=1;}`
` I=0,N=d0.length;while(I<N){d0[I]=+d0[I],I+=1;}`
` //=== <resampling> ===`
` I=0;while(I<d2){`
` dBts=bootstrap(d1,N),c=_FtU(d0,dBts);`
` //P=[p-value for F,p-value for t,p-value for U]`
` P[I]=[fprob(c.f[1],c.f[2],c.f[0]),tprob(c.t[1],c.t[0]),uprob(c.u[1])];`
` I+=1;}`
` //=== </resampling> ===`
` I=0,N=P.length;while(I<N){`
` p=P[I];`
` X[0]+=p[0]<d3?1:0;`
` X[1]+=p[1]<d3?1:0;`
` X[2]+=p[2]<d3?1:0;`
` pJn[I]=p.join();`
` I+=1;}`
` X=[X[0]/N,X[1]/N,X[2]/N];`
` slf.postMessage({FtU:X,p:pJn});`
` c=dBts=P=pJn=null;`
`},true);`
- [statDist2.js] line 12-14 in statDist.js: `//{FtU:[(F<crit)/T,(t<crit)/T,(U<crit)/T],p:['p(F),p(t),p(U)', ..., 'p(F),p(t),p(U)']}`
`//where T and crit are time of simulation and significance level respectively.`
`//the available data format is two csv formatted numerical arrays, and time of simulation and significance level (0 to 1), separated with '@' as follows:`
`// e.g., '3,4,5@0,1,2@10@0.025'`
- [statDist2.js] line 10 in statDist.js: `//this is Web Worker interface for statistical test (F-test, t-test, and U-test) with bootstrap method.`
- [statDist2.js] line 1-8 in statDist.js:`/*testingFtU`
`* statDist2.js`
`*`
`* Copyright (c) 2016 Yuji SODE <yuji.sode@gmail.com>`
`* https://github.com/YujiSODE/testingFtU`
`*`
`* This is modified from statDist (Yuji SODE,2016): the Artistic License;`
`* https://github.com/YujiSODE/statDist`
`*`
`* This is released under the Artistic License.`
`* See http://dev.perl.org/licenses/ and http://dev.perl.org/licenses/artistic.html`
`* or LICENSE.`
`*/`

##Added
- [statDist2.js] line 41 in statDist.js: added modified version of bootstrapEst-2.1/bootstrapMdl.js
- added files: statDist2.js modified from statDist (Yuji SODE,2016), subStatDist2.js, and testingFtU2.html

##Removed
- [bootstrapEst-2.1/bootstrapMdl.js] line 6-13: removed removable white space

##Changed
- [bootstrapEst-2.1/bootstrapMdl.js] line 13: `}`
- [bootstrapEst-2.1/bootstrapMdl.js] line 6: `function bootstrap(A,n){`
- [bootstrapEst-2.1/bootstrapMdl.js] line 14: `/*bootstrapEst-2.1/bootstrapMdl.js (Yuji SODE,2016)*/`
- [bootstrapEst-2.1/bootstrapMdl.js] line 1-10: `/*bootstrapEst-2.1/bootstrapMdl.js (Yuji SODE,2016)`
`* This software is released under the MIT License. See http://opensource.org/licenses/mit-license.php`
`* the simple interface for estimation of a value of statistic, with bootstrap Method (Efron,1979).`
`* reference: Efron, B. 1979. Bootstrap Methods: Another Look at the Jackknife. Ann. Statist. vol. 7, no. 1, p. 1-26.`
`*/`
- [subStatDist.js] line 44: `restB=f('input','resetB'+r9,fmR.id),restB.type='button',restB.value='Clear';`

## [1.1] - 2016-08-28
##Changed
- [subStatDist.js] line 43: `br01=f('br','br01_'+r9,fmR.id);`
Expand Down
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,39 @@ https://github.com/YujiSODE/testingFtU
______

##Script
###[2 sample test]
* testingFtU.html
* statDist.js
* subStatDist.js

###[Test with bootstrap method]
* testingFtU2.html
* statDist2.js
* subStatDist2.js

##How to use
###Sample data
* The "Sample A" and "Sample B": sample inputs (available data is csv formatted numerical array).
* "Run" button; it runs three statistical tests(F-test, t-test, and U-test) with two given sample(Sample A and Sample B),
and outputs the test result.
* "Reset" button; it clears the test results by "Run" button.
* "Output as email" button; it saves the test results by "Run" button as email to given address.
###[2 sample test]
* **"Sample A" and "Sample B":** sample inputs (available data is csv formatted numerical array).
* **"Run" button;** it runs three statistical tests(F-test, t-test, and U-test) with two given sample(Sample A and Sample B),
and outputs the test results as the upper probabilities.
* **"Clear" button;** it clears the test results by "Run" button.
* **"Output as email" button;** it saves the test results by "Run" button as email to given address.

###[Test with bootstrap method]
* **"Sample":** sample input (available data is csv formatted numerical array).
* **"Resampling from":** sample input to be resampled in bootstrap method (available data is csv formatted numerical array).
* **"Time of simulation";** it sets how many times the sample and resampled data are tested.
* **"Significance level";** it sets a statistical significance level (0-1) in order to test if the null hypothesis (no difference) is rejected.
* **"Run" button;** it runs three statistical tests(F-test, t-test, and U-test) with the given sample and resampled data,
and outputs the test results: three rates of the null hypothesis rejection, and details expressed with the upper probabilities.
* **"Clear" button;** it clears the test results by "Run" button.
* **"Output as email" button;** it saves the test results by "Run" button as email to given address.

##Library list
* statDist.js (Yuji SODE,2016): the Artistic License or the GPL v1 or later; https://github.com/YujiSODE/statDist

>* statistics-distributions-js_Ymdf.js (Ben Tilly,2008; modified by Yuji SODE, 2016):
> the Artistic License or the GPL v1 or later; https://github.com/YujiSODE/statistics-distributions-js_Ymdf
>* calcStat_FtU.js (Yuji SODE, 2016): the MIT License; https://github.com/YujiSODE/calcStat_FtU
* bootstrapEst-2.1/bootstrapMdl.js (Yuji SODE,2016): the MIT License; https://github.com/YujiSODE/bootstrapEst
67 changes: 67 additions & 0 deletions statDist2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions subStatDist.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var slf=this.window,W,r9=slf.Math.random().toFixed(9).replace(/\./g,''),cObj;
return t.appendChild(E);
};
//=========================
var B,tDiv,fm,fmR,lbA,ipA,lbB,ipB,Btn,TxtALb,txtA,br01,restB,adrsLbl,adrs,sbmtB,t,D=[];
var B,tDiv,fm,fmR,lbA,ipA,lbB,ipB,Btn,TxtALb,txtA,br01,restB,adrsLbl,adrs,sbmtB,t,D=[],lk;
B=slf.document.getElementsByTagName('body')[0];B.id='B'+r9;
tDiv=f('div','div'+r9,B.id),B.removeAttribute('id');
//<form>
Expand All @@ -41,7 +41,7 @@ var B,tDiv,fm,fmR,lbA,ipA,lbB,ipB,Btn,TxtALb,txtA,br01,restB,adrsLbl,adrs,sbmtB,
TxtALb=f('label','labelTxtArea'+r9,fmR.id),TxtALb.innerHTML='<br>Result:';
txtA=f('textarea','result'+r9,TxtALb.id),txtA.name='Result';
br01=f('br','br01_'+r9,fmR.id);
restB=f('input','resetB'+r9,fmR.id),restB.type='button',restB.value='Reset';
restB=f('input','resetB'+r9,fmR.id),restB.type='button',restB.value='Clear';
adrsLbl=f('label','adrsLbl'+r9,fmR.id),adrsLbl.innerHTML='<br>Email address:';
adrs=f('input','adrs'+r9,adrsLbl.id),adrs.type='email',adrs.value='123.example@qwerty.com';
sbmtB=f('input','submitB'+r9,fmR.id),sbmtB.type='submit',sbmtB.value='Output as email';
Expand All @@ -50,6 +50,7 @@ var B,tDiv,fm,fmR,lbA,ipA,lbB,ipB,Btn,TxtALb,txtA,br01,restB,adrsLbl,adrs,sbmtB,
F.action='mailto:'+this.value+'?subject='+slf.document.getElementsByTagName('title')[0].innerHTML+': '+slf.Date().replace(/\s/g,'_');
},true);
//</output as email>
lk=f('a','link'+r9,tDiv.id),lk.innerHTML='<br>Test with bootstrap method',lk.href='./testingFtU2.html';
//============ web worker ============
W=new Worker('./statDist.js');
W.addEventListener('error',function(e){console.log(e.message),W.terminate();},true);
Expand Down
Loading

0 comments on commit 3bf4ca5

Please sign in to comment.