Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia language: is there a t-test?

Tags:

julia

I am quite new to Julia language. I would like to know if this language implements some statistical tests, in particular t-test for comparison of means.And if so, how can I invoke it?

like image 938
Capitão Ahab Avatar asked Dec 19 '22 21:12

Capitão Ahab


1 Answers

You can use HypothesisTests.jl for this -- relevant docs.

(See also: The website juliastats.github.io neatly lists packages in Julia for stats and ML)

Here's how you could probably go about it:

julia> Pkg.add("HypothesisTests")
julia> using HypothesisTests
julia> xs = [1, 2, 3, 4]
julia> ys = [5, 6, 7, 8]
julia> OneSampleTTest(vec(xs), vec(ys))
One sample t-test
-----------------
Population details:
    parameter of interest:    Mean
    value under h_0:          0
    point estimate:           -4.0
    95% confidence interval:  (-4.0,-4.0)

Test summary:
    outcome with 95% confidence: reject h_0
    two-sided p-value:           0.0 (extremely significant)

Details:
    number of observations:   4
    t-statistic:              -Inf
    degrees of freedom:       3
    empirical standard error: 0.0

(... above example just illustrates the usage of the function, data does not mean anything).

like image 156
ComputerFellow Avatar answered Dec 31 '22 19:12

ComputerFellow