From e56a87e3ad4718e4e4c9af2404e3b2662c595669 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sat, 16 Dec 2017 19:56:22 -0800 Subject: [PATCH] Add a test to increase coverage --- test/runtests.jl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index f723b7f..bd07443 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -153,6 +153,22 @@ end outcome = coxph(@formula(event ~ fin+age+race+wexp+mar+paro+prio), rossi; tol = 1e-8) outcome_coefmat = coeftable(outcome) + @test sprint(show, outcome) == """ + StatsModels.DataFrameRegressionModel{Survival.CoxModel{Float64},Array{Float64,2}} + + Formula: event ~ fin + age + race + wexp + mar + paro + prio + + Coefficients: + Estimate Std.Error z value Pr(>|z|) + fin -0.379422 0.191379 -1.98256 0.0474 + age -0.0574377 0.0219995 -2.61087 0.0090 + race 0.3139 0.307993 1.01918 0.3081 + wexp -0.149796 0.212224 -0.705837 0.4803 + mar -0.433704 0.381868 -1.13574 0.2561 + paro -0.0848711 0.195757 -0.433554 0.6646 + prio 0.0914971 0.0286485 3.19378 0.0014 + """ + coef_matrix = ModelMatrix(ModelFrame(@formula(event ~ 0+fin+age+race+wexp+mar+paro+prio), rossi)).m outcome_from_matrix = coxph(coef_matrix, rossi[:event]; tol = 1e-8, l2_cost = 0) outcome_from_matrix32 = coxph(Float32.(coef_matrix), rossi[:event]; tol = 1e-5) @@ -220,4 +236,4 @@ end end @test_throws ErrorException Survival.newton_raphson(wrong_fgh!, [2.2]) -end \ No newline at end of file +end