Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rimhajal committed May 23, 2024
1 parent 6c32f2a commit 1409ec8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
15 changes: 13 additions & 2 deletions docs/src/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
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.
6 changes: 5 additions & 1 deletion docs/src/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/Nessie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down

0 comments on commit 1409ec8

Please sign in to comment.