abanalyzer 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/README.rdoc +28 -0
- data/docs/ABAnalyzer.html +336 -0
- data/docs/ABAnalyzer/ABTest.html +559 -0
- data/docs/ABAnalyzer/InsufficientDataError.html +152 -0
- data/docs/ABAnalyzer/Matrix.html +547 -0
- data/docs/ABAnalyzer/MatrixFormatError.html +152 -0
- data/docs/README_rdoc.html +237 -0
- data/docs/created.rid +8 -0
- data/docs/index.html +108 -0
- data/docs/lib/abanalyzer/abtest_rb.html +54 -0
- data/docs/lib/abanalyzer/exceptions_rb.html +52 -0
- data/docs/lib/abanalyzer/matrix_rb.html +52 -0
- data/docs/lib/abanalyzer/sample_rb.html +54 -0
- data/docs/lib/abanalyzer/version_rb.html +52 -0
- data/docs/lib/abanalyzer_rb.html +62 -0
- data/docs/rdoc.css +706 -0
- data/lib/abanalyzer/sample.rb +5 -4
- data/lib/abanalyzer/version.rb +1 -1
- metadata +24 -3
data/lib/abanalyzer/sample.rb
CHANGED
@@ -22,9 +22,10 @@ module ABAnalyzer
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# Calculate the confidence interval given the number of successes and trials at
|
25
|
-
# the desired level
|
26
|
-
def self.confidence_interval(successes, trials,
|
25
|
+
# the desired confidence level. Returns an Array of [lower, upper]
|
26
|
+
def self.confidence_interval(successes, trials, confidence)
|
27
27
|
sides = 2.0
|
28
|
+
alpha = 1 - confidence
|
28
29
|
zcrit = Statistics2.pnormaldist(1 - (alpha / sides))
|
29
30
|
p = successes.to_f / trials.to_f
|
30
31
|
|
@@ -34,8 +35,8 @@ module ABAnalyzer
|
|
34
35
|
|
35
36
|
# Like confidence_interval, but returns the relative interval compared to the baseline given
|
36
37
|
# in compared_proportion
|
37
|
-
def self.relative_confidence_interval(successes, trials, compared_proportion,
|
38
|
-
ci = confidence_interval(successes, trials,
|
38
|
+
def self.relative_confidence_interval(successes, trials, compared_proportion, confidence)
|
39
|
+
ci = confidence_interval(successes, trials, confidence)
|
39
40
|
[(ci.first - compared_proportion) / compared_proportion, (ci.last - compared_proportion) / compared_proportion]
|
40
41
|
end
|
41
42
|
|
data/lib/abanalyzer/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abanalyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-08-17 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: statistics2
|
16
|
-
requirement: &
|
16
|
+
requirement: &70207977405440 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0.54'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70207977405440
|
25
25
|
description: A/B test analysis library for Ruby
|
26
26
|
email: brian.muller@livingsocial.com
|
27
27
|
executables: []
|
@@ -39,6 +39,21 @@ files:
|
|
39
39
|
- LICENSE
|
40
40
|
- Rakefile
|
41
41
|
- README.rdoc
|
42
|
+
- docs/ABAnalyzer/ABTest.html
|
43
|
+
- docs/ABAnalyzer/InsufficientDataError.html
|
44
|
+
- docs/ABAnalyzer/Matrix.html
|
45
|
+
- docs/ABAnalyzer/MatrixFormatError.html
|
46
|
+
- docs/ABAnalyzer.html
|
47
|
+
- docs/created.rid
|
48
|
+
- docs/index.html
|
49
|
+
- docs/lib/abanalyzer/abtest_rb.html
|
50
|
+
- docs/lib/abanalyzer/exceptions_rb.html
|
51
|
+
- docs/lib/abanalyzer/matrix_rb.html
|
52
|
+
- docs/lib/abanalyzer/sample_rb.html
|
53
|
+
- docs/lib/abanalyzer/version_rb.html
|
54
|
+
- docs/lib/abanalyzer_rb.html
|
55
|
+
- docs/rdoc.css
|
56
|
+
- docs/README_rdoc.html
|
42
57
|
homepage: https://github.com/livingsocial/abanalyzer
|
43
58
|
licenses: []
|
44
59
|
post_install_message:
|
@@ -51,12 +66,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
66
|
- - ! '>='
|
52
67
|
- !ruby/object:Gem::Version
|
53
68
|
version: '0'
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
hash: -4408374484081118835
|
54
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
73
|
none: false
|
56
74
|
requirements:
|
57
75
|
- - ! '>='
|
58
76
|
- !ruby/object:Gem::Version
|
59
77
|
version: '0'
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
hash: -4408374484081118835
|
60
81
|
requirements: []
|
61
82
|
rubyforge_project: abanalyzer
|
62
83
|
rubygems_version: 1.8.17
|