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

remove crappy examples #17

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/src/examples.md
Original file line number Diff line number Diff line change
@@ -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)
"""
```
13 changes: 0 additions & 13 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
Loading