# Levene's Test¶

This example demonstrates how a levene test can be performed by using Daru::Vector and the Statsample::Test::Levene class.

Levene's test is an inferential statistic used to assess the equality of variances for a variable calculated for two or more groups.

#### References¶

http://en.wikipedia.org/wiki/Levene%27s_test

In [8]:
require 'statsample'

Statsample::Analysis.store(Statsample::Test::Levene) do

a = Daru::Vector.new([1,2,3,4,5,6,7,8,100,10])
puts "variance a : #{a.variance}"
b = Daru::Vector.new([30,40,50,60,70,80,90,100,110,120])
puts "variance b : #{b.variance}\n\n"
summary(levene([a,b]))
end
Statsample::Analysis.run_batch

variance a : 908.0444444444445
variance b : 916.6666666666666

Analysis 2015-06-03 23:40:13 +0530
= Statsample::Test::Levene
Levene Test : F(1, 18) = 0.7781 , p = 0.3893