RosettaCodeData/Task/Permutation-test/Julia/permutation-test-2.julia

14 lines
557 B
Text
Raw Permalink Normal View History

2018-06-22 20:57:24 +00:00
const treated = [85, 88, 75, 66, 25, 29, 83, 39, 97]
const control = [68, 41, 10, 49, 16, 65, 32, 92, 28, 98]
2015-11-18 06:14:39 +00:00
2018-06-22 20:57:24 +00:00
(better, worse) = permutation_test(treated, control)
2015-11-18 06:14:39 +00:00
tot = better + worse
println("Permutation test using the following data:")
2018-06-22 20:57:24 +00:00
println("Treated: ", treated)
2015-11-18 06:14:39 +00:00
println("Control: ", control)
2018-06-22 20:57:24 +00:00
println("\nThere are $tot different permuted groups of these data.")
@printf("%8d, %5.2f%% showed better than actual results.\n", better, 100 * better / tot)
print(@sprintf("%8d, %5.2f%% showed equalivalent or worse results.", worse, 100 * worse / tot))