Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Add dependence structures #76

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

[Feat] Add dependence structures #76

wants to merge 18 commits into from

Conversation

lrnv
Copy link
Member

@lrnv lrnv commented Nov 26, 2024

This PR allows to relax the independecne assumptions, witht eh methodolgy of my last paper. The interface goes as follows for the test (and similarly for the estimators) :

julia> fit(GraffeoTest, @formula(Surv(time,status)~stage), colrec, slopop)
Grafféo's log-rank-type-test (Method: NetSurvival.PoharPermeMethod())
1×3 DataFrame
 Row │ test_statistic  degrees_of_freedom  p_value
     │ Float64         Int64               Float64
─────┼──────────────────────────────────────────────────
   1658.779                   3  1.81926e-142

julia> fit(GraffeoTest(ClaytonCopula(2,0.3)), @formula(Surv(time,status)~stage), colrec, slopop)
Grafféo's log-rank-type-test (Method: NetSurvival.GenPoharPermeMethod{ClaytonCopula{2, Float64}}(ClaytonCopula{2, Float64}(
G: Copulas.ClaytonGenerator{Float64}(0.3)
)
))
1×3 DataFrame
 Row │ test_statistic  degrees_of_freedom  p_value
     │ Float64         Int64               Float64
─────┼──────────────────────────────────────────────────
   1665.707                   3  5.72664e-144

julia> fit(GraffeoTest(FrankCopula(2,-10)), @formula(Surv(time,status)~stage), colrec, slopop)
Grafféo's log-rank-type-test (Method: NetSurvival.GenPoharPermeMethod{FrankCopula{2, Int64}}(FrankCopula{2, Int64}(
G: Copulas.FrankGenerator{Int64}(-10)
)
))
1×3 DataFrame
 Row │ test_statistic  degrees_of_freedom  p_value
     │ Float64         Int64               Float64
─────┼────────────────────────────────────────────────
   112.4529                   3  0.00598223

julia> fit(GraffeoTest(FrankCopula(2,-20)), @formula(Surv(time,status)~stage), colrec, slopop)
Grafféo's log-rank-type-test (Method: NetSurvival.GenPoharPermeMethod{FrankCopula{2, Int64}}(FrankCopula{2, Int64}(
G: Copulas.FrankGenerator{Int64}(-20)
)
))
1×3 DataFrame
 Row │ test_statistic  degrees_of_freedom  p_value
     │ Float64         Int64               Float64
─────┼──────────────────────────────────────────────
   14.77414                   3  0.189103

julia>

I also rewrote the test to use less space since we were storing things that were not necessary. The test allows allows to use EdererI or EdererII now, which is... funny, but probably useless as the theory does not hold for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant