Add survival-function estimator macros (empirical, KM, Nelson-Aalen) - #76
Merged
Merged
Conversation
Define \emp, \km, \naa as composable estimator-label subscripts, then build \hsurvemp, \hsurvkm, \hsurvnaa (and function-call variants) on top of the existing \hsurv estimator macro so the hat lands only on S, per issue #75.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a small, composable set of survival-function estimator label macros (\emp, \km, \naa) and uses them to define hatted survival estimator macros with subscripts (plus function-call variants), along with the required interpretation-table entries so documentation generation remains complete.
Changes:
- Added estimator label sub-macros (
\emp,\km,\naa) and composed survival estimator macros (\hsurvemp,\hsurvkm,\hsurvnaa). - Added one-argument “function call” variants (
\hsurvempf,\hsurvkmf,\hsurvnaaf) consistent with existing...fpatterns. - Added interpretation entries for all new macros to satisfy the macros-table completeness check.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| macros.qmd | Defines new survival estimator label macros and composed \hsurv... estimator macros (including ...f call variants). |
| interpretations.tsv | Adds interpretation rows for the nine new macros so the macro reference table build remains complete. |
3 tasks
3 tasks
Contributor
|
5 tasks
d-morrison
added a commit
to d-morrison/rme
that referenced
this pull request
Jul 4, 2026
* Use new survival-estimator macros for KM/Nelson-Aalen notation
Replace ad hoc \hat{S}_{KM}(t)/\hat{S}_{NA}(t)-style LaTeX with the
\hsurvkmf{}/\hsurvnaaf{} macros added in d-morrison/macros#76 (issue
d-morrison/macros#75), across the KM/NA estimator definitions,
derivations, exercises, and the competing-risks and midterm-review
chapters. Bumps the latex-macros submodule to pick up the new macros.
* Point latex-macros submodule at merged main (macros#76)
Re-points from the macros#76 branch commit to main now that it has
merged.
* Rename to shortened survival-estimator macros (hskmf, hsnaaf, etc.)
Follows the rename in d-morrison/macros#77: \hsurvkmf -> \hskmf,
\hsurvnaaf -> \hsnaaf, and the corresponding zero-arg/emp forms.
Bumps latex-macros to pick up the rename.
* Point latex-macros submodule at merged main (macros#77)
Re-points from the macros#77 branch commit to main now that it has
merged.
---------
Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\emp,\km,\naaas small composable subscript-label macros for the empirical, Kaplan-Meier, and Nelson-Aalen estimator names.\hsurv(hat-S) macro to define\hsurvemp,\hsurvkm,\hsurvnaa, so the hat lands only overSand the estimator name appears as a subscript (e.g.\hsurvkmrenders as\hsurvempf,\hsurvkmf,\hsurvnaaf(e.g.\hsurvkmf{t}→ $\hat{S}_{\text{KM}}(t)$), following the existing\hSurvfpattern.interpretations.tsvfor all nine new macros (required bymacros-table.qmd's build-time completeness check).Notes
\hsurv/\hSurv/\hSurvfblock inmacros.qmd, since that's the natural home for hat-S-estimator macros.\NAmacro (already means "not-available" placeholder) for the Nelson-Aalen label —\naais a distinct, case-sensitive command name, so there's no collision.\survkm) since KM/NA/empirical are inherently sample-based estimators, not estimands.Test plan
interpretations.tsvhas no missing entries for any macro inmacros.qmd(replicated themacros-table.qmdcompleteness check via a standalone R script, since this sandbox's R installation is missingrmarkdown/sassbuild tooling and couldn't run a fullquarto render).\def/\providecommandlines.quarto renderofmacros-table.qmd,demo-include-in-header.qmd --to pdf, anddemo-shortcode.qmd --to pdfperCONTRIBUTING.md— not run, this sandbox lacks a working R/LaTeX toolchain (rmarkdown'ssassdependency fails to build, nopdflatex). Recommend a maintainer or CI run these before merge.Generated by Claude Code