From 9f5bbb1375e1e1a8ff94fcf758b3a6367fbd2de4 Mon Sep 17 00:00:00 2001 From: rimhajal Date: Tue, 9 Apr 2024 11:22:30 +0200 Subject: [PATCH 1/3] remove crappy examples --- docs/src/index.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 6ca34bc..c178add 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -18,19 +18,6 @@ The package is available on Julia's general registry, and can be installed eithe ] add NetSurvival ``` -```@example -1 == 1 -``` - -```@example 1 -a = 2 -``` - -```@example 1 -a -``` - - ```@index ``` From 51a851654dd4169991d4c2deb89aec12f0724b2d Mon Sep 17 00:00:00 2001 From: rimhajal Date: Fri, 12 Apr 2024 13:21:30 +0200 Subject: [PATCH 2/3] test --- docs/src/examples.md | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/src/examples.md diff --git a/docs/src/examples.md b/docs/src/examples.md new file mode 100644 index 0000000..061ce34 --- /dev/null +++ b/docs/src/examples.md @@ -0,0 +1,45 @@ +```@meta +CurrentModule = NetSurvival +``` + +# Examples + +In this section, we will be showcasing an example on how the key functions in the package work (with a comparaison to the results obtained in the `relsurv` package in R). + +In this example, we will be using the dataset `colrec` which refers to patients with colon and rectal cancer diagnosed in 1994-2000. By loading the `slopop` rate table based on the Slovenian population, we will be able to apply the Pohar Perme estimator as well as the Grafféo log-rank test for net survival analysis purposes. + +```@example +using NetSurvival + +pp = fit(PoharPerme, @formula(Surv(time,status)~1), colrec, slopop) +``` + +```@example +using NetSurvival + +test1 = fit(PoharPerme, @formula(Surv(time,status)~sex), colrec, slopop) +``` + +```@example +using NetSurvival + +test2 = fit(GraffeoTest, @formula(Surv(time,status)~stage), colrec, slopop) +``` + +```@example +using NetSurvival + +test3 = fit(GraffeoTest, @formula(Surv(time,status)~stage+sex), colrec, slopop) +``` + +```@example +using NetSurvival + +test4 = fit(GraffeoTest, @formula(Surv(time,status)~stage+Strata(sex)), colrec, slopop) +``` + +```@example +using NetSurvival + +test5= fit(GraffeoTest, @formula(Surv(time,status)~stage+Strata(sex)+Strata(site)), colrec, slopop) +``` \ No newline at end of file From 766a8348fd1dd8ae7335506c5f35d3d083541c7e Mon Sep 17 00:00:00 2001 From: rimhajal Date: Fri, 12 Apr 2024 13:36:37 +0200 Subject: [PATCH 3/3] time comparaison --- docs/src/examples.md | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/docs/src/examples.md b/docs/src/examples.md index 061ce34..9659210 100644 --- a/docs/src/examples.md +++ b/docs/src/examples.md @@ -9,37 +9,41 @@ In this section, we will be showcasing an example on how the key functions in th In this example, we will be using the dataset `colrec` which refers to patients with colon and rectal cancer diagnosed in 1994-2000. By loading the `slopop` rate table based on the Slovenian population, we will be able to apply the Pohar Perme estimator as well as the Grafféo log-rank test for net survival analysis purposes. ```@example -using NetSurvival - -pp = fit(PoharPerme, @formula(Surv(time,status)~1), colrec, slopop) +pp1 = fit(PoharPerme, @formula(Surv(time,status)~1), colrec, slopop) ``` ```@example -using NetSurvival - -test1 = fit(PoharPerme, @formula(Surv(time,status)~sex), colrec, slopop) +pp2 = fit(PoharPerme, @formula(Surv(time,status)~sex), colrec, slopop) ``` ```@example -using NetSurvival - -test2 = fit(GraffeoTest, @formula(Surv(time,status)~stage), colrec, slopop) +test1 = fit(GraffeoTest, @formula(Surv(time,status)~stage), colrec, slopop) ``` ```@example -using NetSurvival - -test3 = fit(GraffeoTest, @formula(Surv(time,status)~stage+sex), colrec, slopop) +test2 = fit(GraffeoTest, @formula(Surv(time,status)~stage+sex), colrec, slopop) ``` ```@example -using NetSurvival - -test4 = fit(GraffeoTest, @formula(Surv(time,status)~stage+Strata(sex)), colrec, slopop) +test3 = fit(GraffeoTest, @formula(Surv(time,status)~stage+Strata(sex)), colrec, slopop) ``` ```@example -using NetSurvival +test4 = fit(GraffeoTest, @formula(Surv(time,status)~stage+Strata(sex)+Strata(site)), colrec, slopop) +``` -test5= fit(GraffeoTest, @formula(Surv(time,status)~stage+Strata(sex)+Strata(site)), colrec, slopop) -``` \ No newline at end of file +For the sake of comparison, the examples below detail the difference in performance between `NetSurvival.jl` and `relsurv` on R : + +``` +@time fit(PoharPerme, @formula(Surv(time,status)~1), colrec, slopop); +@time R""" +rez = relsurv::rs.surv(survival::Surv(time, stat) ~1, rmap=list(age = age, sex = sex, year = diag), data = relsurv::colrec, ratetable = relsurv::slopop, method = "pohar-perme", add.times=1:8149) +""" +``` + +``` +@time fit(GraffeoTest, @formula(Surv(time,status)~stage), colrec, slopop); +@time R""" +rez = relsurv::rs.diff(survival::Surv(time, stat) ~ stage, rmap=list(age = age, sex = sex, year = diag), data = relsurv::colrec, ratetable = relsurv::slopop) +""" +```