The twoSample program of this page is suggested by Sir Ronald Fisher’s book, The Design of Experiments, Hafner Pub. Co., New York, 1966. Any mistakes in the program are mine, not Fisher’s. The test is exact and non-parametric, and it handles ties correctly, but it is too slow to be used if there are more than twenty data altogether after combining the two samples. The nextPermutation algorithm is by Edsger Dijkstra. See Edsger W. Dijkstra, A Discipline of Programming. Prentice-Hall, Englewood Cliffs, N.J., 1976. Chapter 13. I have merely translated the algorithm into JavaScript. Any mistakes are mine, not Dijkstra’s. Also, I thank Dr. Arvind Nath for bringing to my attention the need for the present page, and for helping with it.
In a following paragraph is an example showing use of the program. The user is respectfully invited to try out this example or to use any others. The only thing to remember is: follow the grammatical rules of JavaScript. (This is because the “eval” method of JavaScript is used in picking up the data from the text area.) Also, the user is respectfully reminded that integers beginning with a zero digit will be understood to be in base eight. To top.
Which browsers?
Modern browsers such as Safari 3, Microsoft Internet Explorer 6, Netscape 7, and Opera 8 can work this page correctly. Netscape 4 is out of date and cannot work this page correctly. To top.
Identity of populations.
Here is an array of two samples of children’s weight increments copied and modified from James V. Bradley, Distribution-Free Tests, Prentice-Hall Inc., 1968, pg. 111-112 and 78-80. Three children got one diet and five other children got another diet. The null hypothesis asserts that the diets are identical in their effects on the children’s weight increments.
[ [10,5,3], [29,25,22,16,8] ]The user is respectfully invited to select and copy the array, click on the “Clear” button to clear the upper text area, paste the array into that text area, and click on the “Fisher’s permutation test for the two-sample problem” button. The answers will appear in the lower text area. Doubtless the user already knows what a “p value” is. For an explanation and example of “normalized negated log p” in Bayesian meta-analysis, I respectfully invite the user to click on martMean.htm#Discrete.
Fisher’s test is non-parametric, and all it does is use permutation. There are no assumptions of normality, no ranking. However, the numbers in the array must be integers. If the user’s data have decimal fractions, it is necessary to multiply them by a power of ten. The program is speedy for small samples, no more than twenty numbers altogether after combining the two samples, but it is prohibitively slow for larger samples. To top.
Run a JavaScript program.
While building this page I needed a way to run little JavaScript programs, so I constructed the “Run a JavaScript program” button. When I was done I left the button so users can practice JavaScript programming with it. If a program is in the upper text area, the button will run it. Here is a trivial example:
var x=[]; for(var j=0;j<10;j++)x[j]=j; x;The user is respectfully invited. To top.
at dot
smtw2gh gmail com
Harold Kaplan’s statistics.htm