camping-abingo 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -0
- data/doc/classes/ABingoCampingPlugin.html +188 -0
- data/doc/classes/ABingoCampingPlugin.src/M000016.html +18 -0
- data/doc/classes/ABingoCampingPlugin.src/M000017.html +18 -0
- data/doc/classes/ABingoCampingPlugin.src/M000018.html +19 -0
- data/doc/classes/ABingoCampingPlugin.src/M000034.html +18 -0
- data/doc/classes/ABingoCampingPlugin.src/M000035.html +18 -0
- data/doc/classes/ABingoCampingPlugin.src/M000036.html +19 -0
- data/doc/classes/ABingoCampingPlugin/ABingo.html +121 -0
- data/doc/classes/ABingoCampingPlugin/Controllers.html +191 -0
- data/doc/classes/ABingoCampingPlugin/Controllers.src/M000022.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Controllers.src/M000023.html +26 -0
- data/doc/classes/ABingoCampingPlugin/Controllers.src/M000040.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Controllers.src/M000041.html +26 -0
- data/doc/classes/ABingoCampingPlugin/Filters.html +158 -0
- data/doc/classes/ABingoCampingPlugin/Filters.src/M000037.html +26 -0
- data/doc/classes/ABingoCampingPlugin/Filters.src/M000055.html +26 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.html +372 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000024.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000025.html +19 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000026.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000027.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000028.html +36 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000029.html +28 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000030.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000031.html +48 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000032.html +32 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000033.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000034.html +26 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000035.html +20 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000036.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000042.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000043.html +19 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000044.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000045.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000046.html +36 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000047.html +28 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000048.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000049.html +48 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000050.html +32 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000051.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000052.html +26 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000053.html +20 -0
- data/doc/classes/ABingoCampingPlugin/Helpers.src/M000054.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Models.html +208 -0
- data/doc/classes/ABingoCampingPlugin/Models.src/M000038.html +22 -0
- data/doc/classes/ABingoCampingPlugin/Models.src/M000039.html +39 -0
- data/doc/classes/ABingoCampingPlugin/Models.src/M000040.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models.src/M000056.html +22 -0
- data/doc/classes/ABingoCampingPlugin/Models.src/M000057.html +39 -0
- data/doc/classes/ABingoCampingPlugin/Models.src/M000058.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Alternative.html +181 -0
- data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000041.html +20 -0
- data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000042.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000043.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000059.html +20 -0
- data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000060.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000061.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.html +273 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000044.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000045.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000046.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000047.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000048.html +20 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000049.html +23 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000050.html +29 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000051.html +50 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000052.html +28 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000062.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000063.html +21 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000064.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000065.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000066.html +20 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000067.html +23 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000068.html +29 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000069.html +50 -0
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000070.html +28 -0
- data/doc/classes/ABingoCampingPlugin/Views.html +196 -0
- data/doc/classes/ABingoCampingPlugin/Views.src/M000019.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Views.src/M000020.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Views.src/M000021.html +30 -0
- data/doc/classes/ABingoCampingPlugin/Views.src/M000037.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Views.src/M000038.html +18 -0
- data/doc/classes/ABingoCampingPlugin/Views.src/M000039.html +30 -0
- data/doc/classes/Abingo.html +429 -0
- data/doc/classes/Abingo.src/M000001.html +18 -0
- data/doc/classes/Abingo.src/M000002.html +18 -0
- data/doc/classes/Abingo.src/M000003.html +18 -0
- data/doc/classes/Abingo.src/M000004.html +22 -0
- data/doc/classes/Abingo.src/M000005.html +69 -0
- data/doc/classes/Abingo.src/M000006.html +47 -0
- data/doc/classes/Abingo.src/M000007.html +31 -0
- data/doc/classes/Abingo.src/M000008.html +36 -0
- data/doc/classes/Abingo.src/M000009.html +18 -0
- data/doc/classes/Abingo.src/M000010.html +36 -0
- data/doc/classes/Abingo.src/M000011.html +22 -0
- data/doc/classes/Abingo.src/M000012.html +21 -0
- data/doc/classes/Abingo.src/M000013.html +18 -0
- data/doc/classes/Abingo.src/M000014.html +39 -0
- data/doc/classes/Abingo.src/M000015.html +25 -0
- data/doc/classes/ActiveSupport.html +107 -0
- data/doc/classes/ActiveSupport/Cache.html +111 -0
- data/doc/classes/ActiveSupport/Cache/MemoryStore.html +137 -0
- data/doc/classes/ActiveSupport/Cache/MemoryStore.src/M000016.html +18 -0
- data/doc/classes/CampingABingoTest.html +149 -0
- data/doc/classes/CampingABingoTest.src/M000017.html +24 -0
- data/doc/classes/CampingABingoTest/Controllers.html +116 -0
- data/doc/classes/CampingABingoTest/Controllers/Index.html +137 -0
- data/doc/classes/CampingABingoTest/Controllers/Index.src/M000024.html +18 -0
- data/doc/classes/CampingABingoTest/Controllers/Landing.html +137 -0
- data/doc/classes/CampingABingoTest/Controllers/Landing.src/M000026.html +18 -0
- data/doc/classes/CampingABingoTest/Controllers/SignIn.html +152 -0
- data/doc/classes/CampingABingoTest/Controllers/SignIn.src/M000030.html +18 -0
- data/doc/classes/CampingABingoTest/Controllers/SignIn.src/M000031.html +34 -0
- data/doc/classes/CampingABingoTest/Controllers/SignOut.html +137 -0
- data/doc/classes/CampingABingoTest/Controllers/SignOut.src/M000029.html +21 -0
- data/doc/classes/CampingABingoTest/Controllers/SignUp.html +152 -0
- data/doc/classes/CampingABingoTest/Controllers/SignUp.src/M000027.html +23 -0
- data/doc/classes/CampingABingoTest/Controllers/SignUp.src/M000028.html +33 -0
- data/doc/classes/CampingABingoTest/Controllers/Welcome.html +137 -0
- data/doc/classes/CampingABingoTest/Controllers/Welcome.src/M000025.html +18 -0
- data/doc/classes/CampingABingoTest/Helpers.html +112 -0
- data/doc/classes/CampingABingoTest/Models.html +119 -0
- data/doc/classes/CampingABingoTest/Models/CreateUserSchema.html +152 -0
- data/doc/classes/CampingABingoTest/Models/CreateUserSchema.src/M000032.html +26 -0
- data/doc/classes/CampingABingoTest/Models/CreateUserSchema.src/M000033.html +19 -0
- data/doc/classes/CampingABingoTest/Models/User.html +111 -0
- data/doc/classes/CampingABingoTest/Views.html +206 -0
- data/doc/classes/CampingABingoTest/Views.src/M000018.html +70 -0
- data/doc/classes/CampingABingoTest/Views.src/M000019.html +22 -0
- data/doc/classes/CampingABingoTest/Views.src/M000020.html +51 -0
- data/doc/classes/CampingABingoTest/Views.src/M000021.html +31 -0
- data/doc/classes/CampingABingoTest/Views.src/M000022.html +31 -0
- data/doc/classes/CampingABingoTest/Views.src/M000023.html +20 -0
- data/doc/created.rid +1 -0
- data/doc/files/examples/camping-abingo-test/camping-abingo-test_rb.html +101 -0
- data/doc/files/lib/camping-abingo_rb.html +457 -0
- data/doc/fr_class_index.html +52 -0
- data/doc/fr_file_index.html +28 -0
- data/doc/fr_method_index.html +96 -0
- data/doc/index.html +24 -0
- data/lib/camping-abingo.rb +1233 -0
- metadata +279 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>log_debug (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 569</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_debug</span>(<span class="ruby-identifier">msg</span>)
|
15
|
+
<span class="ruby-constant">ABingoCampingPlugin</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-identifier">msg</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ABingoCampingPlugin</span>.<span class="ruby-identifier">logger</span> <span class="ruby-operator">&&</span> <span class="ruby-constant">ABingoCampingPlugin</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug?</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>app_module (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 574</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">app_module</span>
|
15
|
+
<span class="ruby-identifier">app_module_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"::"</span>).<span class="ruby-identifier">first</span>
|
16
|
+
<span class="ruby-identifier">app_module</span> = <span class="ruby-identifier">app_module_name</span>.<span class="ruby-identifier">constantize</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>conversion_rate (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 580</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">conversion_rate</span>
|
15
|
+
<span class="ruby-value">1.0</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">conversions</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">participants</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>pretty_conversion_rate (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 584</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pretty_conversion_rate</span>
|
15
|
+
<span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">"%4.2f%%"</span>, <span class="ruby-identifier">conversion_rate</span> <span class="ruby-operator">*</span> <span class="ruby-value">100</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>zscore (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 595</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zscore</span>
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">alternatives</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">!=</span> <span class="ruby-value">2</span>
|
16
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Sorry, can't currently automatically calculate statistics for A/B tests with > 2 alternatives."</span>
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
|
19
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">alternatives</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">participants</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">alternatives</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">participants</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>)
|
20
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Can't calculate the z score if either of the alternatives lacks participants."</span>
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
|
23
|
+
<span class="ruby-identifier">cr1</span> = <span class="ruby-identifier">alternatives</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">conversion_rate</span>
|
24
|
+
<span class="ruby-identifier">cr2</span> = <span class="ruby-identifier">alternatives</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">conversion_rate</span>
|
25
|
+
|
26
|
+
<span class="ruby-identifier">n1</span> = <span class="ruby-identifier">alternatives</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">participants</span>
|
27
|
+
<span class="ruby-identifier">n2</span> = <span class="ruby-identifier">alternatives</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">participants</span>
|
28
|
+
|
29
|
+
<span class="ruby-identifier">numerator</span> = <span class="ruby-identifier">cr1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cr2</span>
|
30
|
+
<span class="ruby-identifier">frac1</span> = <span class="ruby-identifier">cr1</span> <span class="ruby-operator">*</span> (<span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cr1</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">n1</span>
|
31
|
+
<span class="ruby-identifier">frac2</span> = <span class="ruby-identifier">cr2</span> <span class="ruby-operator">*</span> (<span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cr2</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">n2</span>
|
32
|
+
|
33
|
+
<span class="ruby-identifier">numerator</span> <span class="ruby-operator">/</span> ((<span class="ruby-identifier">frac1</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">frac2</span>) <span class="ruby-operator">**</span> <span class="ruby-value">0</span><span class="ruby-value">.5</span>)
|
34
|
+
<span class="ruby-keyword kw">end</span></pre>
|
35
|
+
</body>
|
36
|
+
</html>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>p_value (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 617</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">p_value</span>
|
15
|
+
<span class="ruby-identifier">index</span> = <span class="ruby-value">0</span>
|
16
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-identifier">zscore</span>
|
17
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-identifier">z</span>.<span class="ruby-identifier">abs</span>
|
18
|
+
<span class="ruby-identifier">found_p</span> = <span class="ruby-keyword kw">nil</span>
|
19
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">index</span> <span class="ruby-operator"><</span> <span class="ruby-constant">HANDY_Z_SCORE_CHEATSHEET</span>.<span class="ruby-identifier">size</span> <span class="ruby-keyword kw">do</span>
|
20
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">z</span> <span class="ruby-operator">></span> <span class="ruby-constant">HANDY_Z_SCORE_CHEATSHEET</span>[<span class="ruby-identifier">index</span>][<span class="ruby-value">1</span>])
|
21
|
+
<span class="ruby-identifier">found_p</span> = <span class="ruby-constant">HANDY_Z_SCORE_CHEATSHEET</span>[<span class="ruby-identifier">index</span>][<span class="ruby-value">0</span>]
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-identifier">index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
25
|
+
<span class="ruby-identifier">found_p</span>
|
26
|
+
<span class="ruby-keyword kw">end</span></pre>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>is_statistically_significant? (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 631</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_statistically_significant?</span>(<span class="ruby-identifier">p</span> = <span class="ruby-value">0</span><span class="ruby-value">.05</span>)
|
15
|
+
<span class="ruby-identifier">p_value</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">p</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>describe_result_in_words (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 635</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">describe_result_in_words</span>
|
15
|
+
<span class="ruby-keyword kw">begin</span>
|
16
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-identifier">zscore</span>
|
17
|
+
<span class="ruby-keyword kw">rescue</span>
|
18
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-value str">"Could not execute the significance test because one or more of the alternatives has not been seen yet."</span>
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-identifier">p</span> = <span class="ruby-identifier">p_value</span>
|
21
|
+
|
22
|
+
<span class="ruby-identifier">words</span> = <span class="ruby-value str">""</span>
|
23
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">alternatives</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">participants</span> <span class="ruby-operator"><</span> <span class="ruby-value">10</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">alternatives</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">participants</span> <span class="ruby-operator"><</span> <span class="ruby-value">10</span>)
|
24
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"Take these results with a grain of salt since your samples are so small: "</span>
|
25
|
+
<span class="ruby-keyword kw">end</span>
|
26
|
+
|
27
|
+
<span class="ruby-identifier">alts</span> = <span class="ruby-identifier">alternatives</span> <span class="ruby-operator">-</span> [<span class="ruby-identifier">best_alternative</span>]
|
28
|
+
<span class="ruby-identifier">worst_alternative</span> = <span class="ruby-identifier">alts</span>.<span class="ruby-identifier">first</span>
|
29
|
+
|
30
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"The best alternative you have is: [#{best_alternative.content}], which had "</span>
|
31
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"#{best_alternative.conversions} conversions from #{best_alternative.participants} participants "</span>
|
32
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"(#{best_alternative.pretty_conversion_rate}). The other alternative was [#{worst_alternative.content}], "</span>
|
33
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"which had #{worst_alternative.conversions} conversions from #{worst_alternative.participants} participants "</span>
|
34
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"(#{worst_alternative.pretty_conversion_rate}). "</span>
|
35
|
+
|
36
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">p</span>.<span class="ruby-identifier">nil?</span>)
|
37
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"However, this difference is not statistically significant."</span>
|
38
|
+
<span class="ruby-keyword kw">else</span>
|
39
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"This difference is #{PERCENTAGES[p]} likely to be statistically significant, which means you can be "</span>
|
40
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"#{DESCRIPTION_IN_WORDS[p]} that it is the result of your alternatives actually mattering, rather than "</span>
|
41
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"being due to random chance. However, this statistical test can't measure how likely the currently "</span>
|
42
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"observed magnitude of the difference is to be accurate or not. It only says \"better\", not \"better "</span>
|
43
|
+
<span class="ruby-identifier">words</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"by so much\"."</span>
|
44
|
+
<span class="ruby-keyword kw">end</span>
|
45
|
+
<span class="ruby-identifier">words</span>
|
46
|
+
<span class="ruby-keyword kw">end</span></pre>
|
47
|
+
</body>
|
48
|
+
</html>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>ab_test (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 671</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ab_test</span>(<span class="ruby-identifier">test_name</span>, <span class="ruby-identifier">alternatives</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {})
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:enable_specification</span>] <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@input</span>.<span class="ruby-identifier">test_name</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-comment cmt"># Camping-specific</span>
|
16
|
+
<span class="ruby-identifier">choice</span> = <span class="ruby-ivar">@input</span>.<span class="ruby-identifier">test_name</span> <span class="ruby-comment cmt"># Camping-specific</span>
|
17
|
+
<span class="ruby-keyword kw">elsif</span> (<span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:enable_override_in_session</span>] <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@state</span>.<span class="ruby-identifier">test_name</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-comment cmt"># Camping-specific</span>
|
18
|
+
<span class="ruby-identifier">choice</span> = <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">test_name</span> <span class="ruby-comment cmt"># Camping-specific</span>
|
19
|
+
<span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">alternatives</span>.<span class="ruby-identifier">nil?</span>)
|
20
|
+
<span class="ruby-identifier">choice</span> = <span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">flip</span>(<span class="ruby-identifier">test_name</span>)
|
21
|
+
<span class="ruby-keyword kw">else</span>
|
22
|
+
<span class="ruby-identifier">choice</span> = <span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">test</span>(<span class="ruby-identifier">test_name</span>, <span class="ruby-identifier">alternatives</span>, <span class="ruby-identifier">options</span>)
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
|
25
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
26
|
+
<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">choice</span>)
|
27
|
+
<span class="ruby-keyword kw">else</span>
|
28
|
+
<span class="ruby-identifier">choice</span>
|
29
|
+
<span class="ruby-keyword kw">end</span>
|
30
|
+
<span class="ruby-keyword kw">end</span></pre>
|
31
|
+
</body>
|
32
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>bingo! (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 689</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bingo!</span>(<span class="ruby-identifier">test_name</span>, <span class="ruby-identifier">options</span> = {})
|
15
|
+
<span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">bingo!</span>(<span class="ruby-identifier">test_name</span>, <span class="ruby-identifier">options</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>set_abingo_identity (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 694</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_abingo_identity</span> <span class="ruby-comment cmt"># Camping-specific</span>
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@user</span>
|
16
|
+
<span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">identity</span> = <span class="ruby-ivar">@user</span>.<span class="ruby-identifier">id</span>
|
17
|
+
<span class="ruby-keyword kw">else</span>
|
18
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">abingo_identity</span>
|
19
|
+
<span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">identity</span> = <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">abingo_identity</span>
|
20
|
+
<span class="ruby-keyword kw">else</span>
|
21
|
+
<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">abingo_identity</span> = <span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">identity</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-value">10</span> <span class="ruby-operator">**</span> <span class="ruby-value">10</span>).<span class="ruby-identifier">to_i</span>
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
<span class="ruby-keyword kw">end</span></pre>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>authenticate_abingo_administrator (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 706</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authenticate_abingo_administrator</span>
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@state</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@state</span>.<span class="ruby-identifier">user_id</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">user_id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">abingo_administrator_user_id</span>
|
16
|
+
<span class="ruby-identifier">redirect</span>(<span class="ruby-value str">'/abingo/restricted_access'</span>)
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>abingo_administrator_user_id (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 712</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">abingo_administrator_user_id</span>
|
15
|
+
<span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:abingo_administrator_user_id</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>log_debug (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 569</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_debug</span>(<span class="ruby-identifier">msg</span>)
|
15
|
+
<span class="ruby-constant">ABingoCampingPlugin</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-identifier">msg</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ABingoCampingPlugin</span>.<span class="ruby-identifier">logger</span> <span class="ruby-operator">&&</span> <span class="ruby-constant">ABingoCampingPlugin</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug?</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>app_module (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 574</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">app_module</span>
|
15
|
+
<span class="ruby-identifier">app_module_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"::"</span>).<span class="ruby-identifier">first</span>
|
16
|
+
<span class="ruby-identifier">app_module</span> = <span class="ruby-identifier">app_module_name</span>.<span class="ruby-identifier">constantize</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>conversion_rate (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 580</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">conversion_rate</span>
|
15
|
+
<span class="ruby-value">1.0</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">conversions</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">participants</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>pretty_conversion_rate (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 584</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pretty_conversion_rate</span>
|
15
|
+
<span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">"%4.2f%%"</span>, <span class="ruby-identifier">conversion_rate</span> <span class="ruby-operator">*</span> <span class="ruby-value">100</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>zscore (ABingoCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-abingo.rb, line 595</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zscore</span>
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">alternatives</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">!=</span> <span class="ruby-value">2</span>
|
16
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Sorry, can't currently automatically calculate statistics for A/B tests with > 2 alternatives."</span>
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
|
19
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">alternatives</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">participants</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">alternatives</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">participants</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>)
|
20
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Can't calculate the z score if either of the alternatives lacks participants."</span>
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
|
23
|
+
<span class="ruby-identifier">cr1</span> = <span class="ruby-identifier">alternatives</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">conversion_rate</span>
|
24
|
+
<span class="ruby-identifier">cr2</span> = <span class="ruby-identifier">alternatives</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">conversion_rate</span>
|
25
|
+
|
26
|
+
<span class="ruby-identifier">n1</span> = <span class="ruby-identifier">alternatives</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">participants</span>
|
27
|
+
<span class="ruby-identifier">n2</span> = <span class="ruby-identifier">alternatives</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">participants</span>
|
28
|
+
|
29
|
+
<span class="ruby-identifier">numerator</span> = <span class="ruby-identifier">cr1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cr2</span>
|
30
|
+
<span class="ruby-identifier">frac1</span> = <span class="ruby-identifier">cr1</span> <span class="ruby-operator">*</span> (<span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cr1</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">n1</span>
|
31
|
+
<span class="ruby-identifier">frac2</span> = <span class="ruby-identifier">cr2</span> <span class="ruby-operator">*</span> (<span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">cr2</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">n2</span>
|
32
|
+
|
33
|
+
<span class="ruby-identifier">numerator</span> <span class="ruby-operator">/</span> ((<span class="ruby-identifier">frac1</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">frac2</span>) <span class="ruby-operator">**</span> <span class="ruby-value">0</span><span class="ruby-value">.5</span>)
|
34
|
+
<span class="ruby-keyword kw">end</span></pre>
|
35
|
+
</body>
|
36
|
+
</html>
|