From 1409ec82662c9e50a9f4435e8ce0d5b10482c18d Mon Sep 17 00:00:00 2001 From: rimhajal Date: Thu, 23 May 2024 10:49:27 +0200 Subject: [PATCH] docs --- docs/src/example.md | 15 +++++++++++++-- docs/src/getting_started.md | 6 +++++- src/Nessie.jl | 6 ++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/src/example.md b/docs/src/example.md index d763bdc..7f94a35 100644 --- a/docs/src/example.md +++ b/docs/src/example.md @@ -245,5 +245,16 @@ Visually, it is almost immediately understood that there are no worthy differenc Given that the age group plays a significant role in the study, we will now estimate the sample size by yearly intervals in order to better compare the age groups. ```@example 2 -ess = nessie(@formula(Surv(time,status)~age65), colrec, slopop) -``` \ No newline at end of file +elt, ess = nessie(@formula(Surv(time,status)~age65), colrec, slopop) +elt +``` + +The expected life time for the younger patients is significatively higher than for older patients (24.78 years > 10.29 years). + +```@example 2 +hcat(ess[:,3]...) +``` + +Finally, the table above represents yearly expected sample sizes for both age groups under 65 and above, with the second column representing the latter. We can see that the sample size decreases for the older patients in a much more dramatic way than for the younger ages. + +Unsurprisingly, we can thus conclude that age plays an important role in the study. \ No newline at end of file diff --git a/docs/src/getting_started.md b/docs/src/getting_started.md index c0e06fb..ce81892 100644 --- a/docs/src/getting_started.md +++ b/docs/src/getting_started.md @@ -123,10 +123,14 @@ This function is highly dependant on the `Life` function taken from the `RateTab The sample size is thus taken by the following formula: -$$ ESS = \sum_i^N S_{P_i} * exp(-\Lambda_p) $$ +$$ESS(t) = \sum_i^N S_{P_i}(t) * \exp(-\Lambda_{P_i}(t))$$ While the estimated lifepsan is directly taken from the `expectation` function. +```@docs +nessie +``` + ## References ```@bibliography diff --git a/src/Nessie.jl b/src/Nessie.jl index 8cfe0f3..c63ee1b 100644 --- a/src/Nessie.jl +++ b/src/Nessie.jl @@ -18,9 +18,11 @@ struct Nessie end """ - nessie(formula, data, ratetable) + nessie -The Nessie function estimates the sample size by yearly intervals as well as averages an estimated lifespan left for a given group. +To call this function, use the formula below: + + nessie(@formula(Surv(time,status)~covariate), data, ratetable) """ function nessie(args...) r = fit(Nessie,args...)