survival 0.0.3 → 0.0.4
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/lib/survival/KaplanMeier.rb +2 -2
- data/lib/survival/version.rb +1 -1
- data/test/survival_test.rb +1 -1
- metadata +1 -1
data/lib/survival/KaplanMeier.rb
CHANGED
@@ -46,9 +46,9 @@ class KaplanMeier
|
|
46
46
|
|
47
47
|
#The median survival time is calculated as the smallest survival time
|
48
48
|
#for which the survivor function is less than or equal to 0.5
|
49
|
-
if ( (s_t <= 50.0) && (median.nil?) )
|
49
|
+
if ( (s_t <= 50.0) && (median.nil?) )
|
50
50
|
median = t
|
51
|
-
|
51
|
+
end
|
52
52
|
|
53
53
|
#Add to plot points
|
54
54
|
if include_horizontal
|
data/lib/survival/version.rb
CHANGED
data/test/survival_test.rb
CHANGED
@@ -6,7 +6,7 @@ class SurvivalTest < ActiveSupport::TestCase
|
|
6
6
|
|
7
7
|
test 'km plot' do
|
8
8
|
p = KaplanMeier.generate_plot_points(SurvivalSample.create_survival_objects(@@survivals))
|
9
|
-
assert_equal [[0, 100], [3, 100], [3, 100.0], [4, 100.0], [4, 0.0]], p
|
9
|
+
assert_equal [[[0, 100], [3, 100], [3, 100.0], [4, 100.0], [4, 0.0]], 4], p
|
10
10
|
end
|
11
11
|
|
12
12
|
test 'survival_sample array' do
|