Is there a way to do a T-test in RUBY?

Is there a way to do a T-test in RUBY? For example, what packages might you need? I've searched for some packages related to statistics, but none of them can do T-test or other statistical tests.

+3


source to share


1 answer


statsample seems to provide it. There is even an example here .

One-sided test:

require 'statsample'

Statsample::Analysis.store(Statsample::Test::T) do
  a=rnorm(10)
  t_1=Statsample::Test.t_one_sample(a,{:u=>50})
  summary t_1
end

Statsample::Analysis.run_batch

      



Output :

Analysis 2014-09-04 12:43:55 +0200
= Statsample::Test::T
  == One Sample T Test
    Sample mean: 0.2265 | Sample sd: 0.9062 | se : 0.2866
    Population mean: 50.0000
    t(9) = -173.6986, p=0.0000 (both tails)
    CI(95%): -50.4217 - -49.1253

      

+3


source







All Articles