Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This Ruby program takes in a hash-array map of unlimited split group name, split trials, and split successes and outputs statistical confidences
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README
chi_prob.rb
example.rb
gtest.rb
gtest_spec.rb

README

Big thanks to Ben Tilly for providing a coding base to start from and a most informative
online slideshow found at elem.com/~btilly/effective-ab-testing/

This repository calculates confidences for multiple split groups against the current winner

Input might look like this:

    sample_predetermined_gtest = {
      :winning_split_group => [1000, 150], 
      :loosing_split_group => [1000, 100], 
      :middle_split_group  => [1000, 125]}

The GTest class is called like this:

    predetermined_gtest = GTest.new sample_predetermined_gtest

The Yates correction is on by default, but can be toggled like this:

    predetermined_gtest.yates = :on

Split results are returned as a hash of arrays
Bellow is just one way to use them:
    
    split_results = predetermined_gtest.compare_split_groups
    array_of_g_stats = [(split_results[:loosing_split_group][0]*10_000).round.to_f / 10_000, 
                        (split_results[:middle_split_group][0]*10_000).round.to_f / 10_000]
    array_of_g_stats.should == [11.0386, 2.4311]

    array_of_confidences = [(split_results[:loosing_split_group][1]*10_000).round.to_f / 10_000, 
                            (split_results[:middle_split_group][1]*10_000).round.to_f / 10_000]
    array_of_confidences.should == [0.9991, 0.8811]


 Copyright (c) 2010 Zach Aysan

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.