{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Levene's Test\n", "\n", "This example demonstrates how a levene test can be performed by using \n", "Daru::Vector and the Statsample::Test::Levene class.\n", " \n", "Levene's test is an inferential statistic used to assess the\n", "equality of variances for a variable calculated for two or more groups.\n", " \n", "#### References\n", " \n", "http://en.wikipedia.org/wiki/Levene%27s_test" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "variance a : 908.0444444444445\n", "variance b : 916.6666666666666\n", "\n", "\n", "Analysis 2015-06-03 23:40:13 +0530\n", "= Statsample::Test::Levene\n", " Levene Test : F(1, 18) = 0.7781 , p = 0.3893\n", "\n" ] } ], "source": [ "require 'statsample'\n", "\n", "Statsample::Analysis.store(Statsample::Test::Levene) do\n", "\n", " a = Daru::Vector.new([1,2,3,4,5,6,7,8,100,10])\n", " puts \"variance a : #{a.variance}\"\n", " b = Daru::Vector.new([30,40,50,60,70,80,90,100,110,120])\n", " puts \"variance b : #{b.variance}\\n\\n\"\n", " summary(levene([a,b]))\n", "end\n", " Statsample::Analysis.run_batch" ] } ], "metadata": { "kernelspec": { "display_name": "Ruby 2.2.1", "language": "ruby", "name": "ruby" }, "language_info": { "file_extension": "rb", "mimetype": "application/x-ruby", "name": "ruby", "version": "2.2.1" } }, "nbformat": 4, "nbformat_minor": 0 }