From 5fb3266ddcb009d5403f6edf2c522ce7ae80f251 Mon Sep 17 00:00:00 2001 From: rimhajal <113822034+rimhajal@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:53:08 +0200 Subject: [PATCH] remove crappy examples (#17) * remove crappy examples * test * time comparaison --- docs/src/examples.md | 49 ++++++++++++++++++++++++++++++++++++++++++++ docs/src/index.md | 13 ------------ 2 files changed, 49 insertions(+), 13 deletions(-) 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..9659210 --- /dev/null +++ b/docs/src/examples.md @@ -0,0 +1,49 @@ +```@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 +pp1 = fit(PoharPerme, @formula(Surv(time,status)~1), colrec, slopop) +``` + +```@example +pp2 = fit(PoharPerme, @formula(Surv(time,status)~sex), colrec, slopop) +``` + +```@example +test1 = fit(GraffeoTest, @formula(Surv(time,status)~stage), colrec, slopop) +``` + +```@example +test2 = fit(GraffeoTest, @formula(Surv(time,status)~stage+sex), colrec, slopop) +``` + +```@example +test3 = fit(GraffeoTest, @formula(Surv(time,status)~stage+Strata(sex)), colrec, slopop) +``` + +```@example +test4 = fit(GraffeoTest, @formula(Surv(time,status)~stage+Strata(sex)+Strata(site)), colrec, slopop) +``` + +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) +""" +``` 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 ```