Skip to content

Commit

Permalink
Merge b0175c3 into 74b25d1
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Dec 18, 2020
2 parents 74b25d1 + b0175c3 commit 8ca1a6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"

[compat]
Distributions = "0.20, 0.21, 0.22, 0.23"
Distributions = "0.20, 0.21, 0.22, 0.23, 0.24"
PositiveFactorizations = "0.2"
StatsBase = "0.30, 0.31, 0.32, 0.33"
StatsModels = "0.6"
Expand Down
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ end


@testset "Cox" begin
rossi = CSV.read(joinpath(@__DIR__, "data", "rossi.csv"))
rossi = CSV.read(joinpath(@__DIR__, "data", "rossi.csv"), DataFrame)
rossi.event = EventTime.(rossi.week, rossi.arrest .== 1)

outcome = coxph(@formula(event ~ fin + age + race + wexp + mar + paro + prio), rossi; tol=1e-8)
Expand Down Expand Up @@ -244,14 +244,14 @@ end
@test coeftable(outcome_fin).rownms == ["fin"]
outcome_finrace = coxph(@formula(event ~ fin * race), rossi; tol=1e-8)
@test coeftable(outcome_finrace).rownms == ["fin", "race","fin & race"]
categorical!(rossi, :fin)
transform!(rossi, :fin => categorical, renamecols = false)
outcome_fincat = coxph(@formula(event ~ fin), rossi; tol=1e-8)
@test coeftable(outcome_fincat).rownms == ["fin: 1"]
@test coef(outcome_fin) coef(outcome_fincat) atol=1e-8
outcome_fincatrace = coxph(@formula(event ~ fin * race), rossi; tol=1e-8)
@test coeftable(outcome_fincatrace).rownms == ["fin: 1", "race","fin: 1 & race"]
@test coef(outcome_fincatrace) coef(outcome_finrace) atol=1e-8
categorical!(rossi, :race)
transform!(rossi, :race => categorical, renamecols = false)
outcome_fincatracecat = coxph(@formula(event ~ fin * race), rossi; tol=1e-8)
@test coeftable(outcome_fincatracecat).rownms == ["fin: 1", "race: 1","fin: 1 & race: 1"]
@test coef(outcome_fincatracecat) coef(outcome_finrace) atol=1e-8
Expand Down

0 comments on commit 8ca1a6f

Please sign in to comment.