examples/u_test.rb in statsample-1.5.0 vs examples/u_test.rb in statsample-2.0.0

- old
+ new

@@ -1,12 +1,20 @@ #!/usr/bin/ruby $:.unshift(File.dirname(__FILE__)+'/../lib') + +# == Description +# +# Example illustrating Mann-Whitney U test with statsample. +# +# == References +# +# http://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test require 'statsample' Statsample::Analysis.store(Statsample::Test::UMannWhitney) do - a=10.times.map {rand(100)}.to_numeric - b=20.times.map {(rand(20))**2+50}.to_numeric + a = Daru::Vector.new(10.times.map {rand(100)}) + b = Daru::Vector.new(20.times.map {(rand(20))**2+50}) u=Statsample::Test::UMannWhitney.new(a,b) summary u end