Skip to content

Commit

Permalink
Enhance documentation for cox_ph_forestplot function to clarify usage…
Browse files Browse the repository at this point in the history
… of adata and summary table
  • Loading branch information
aGuyLearning committed Jan 15, 2025
1 parent 1364d97 commit c0e9b49
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ehrapy/plot/_survival_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,17 @@ def cox_ph_forestplot(
title: str | None = None,
):
"""Generates a forest plot to visualize the coefficients and confidence intervals of a Cox Proportional Hazards model.
The adata object must be populated via the :func:`~ehrapy.tools.cox_ph` function beforehand.
The `adata` object must first be populated using the :func:`~ehrapy.tools.cox_ph` function. This function stores the summary table of the `CoxPHFitter` in the `.uns` attribute of `adata`.
The summary table is created when the model is fitted using the :func:`ehrapy.tl.cox_ph` function.
For more information on the `CoxPHFitter`, see the `Lifelines documentation <https://lifelines.readthedocs.io/en/latest/fitters/regression/CoxPHFitter.html>`_.
Inspired by `zepid.graphics.EffectMeasurePlot <https://readthedocs.org>`_ (zEpid Package, https://pypi.org/project/zepid/).
Args:
adata: :class:`~anndata.AnnData` object containing the summary table from the CoxPHFitter. This object is populated using the :func:`~ehrapy.tools.cox_ph` function.
uns_key: Key in `.uns` where the CoxPHFitter object is stored.
labels: List of labels for each coefficient, default uses the index of the coxph.summary.
adata: :class:`~anndata.AnnData` object containing the summary table from the CoxPHFitter. This is stored in the `.uns` attribute, after fitting the model using :func:`~ehrapy.tl.cox_ph`.
uns_key: Key in `.uns` where :func:`~ehrapy.tools.cox_ph` function stores the summary table.
labels: List of labels for each coefficient, default uses the index of the summary ta
fig_size: Width, height in inches.
t_adjuster: Adjust the table to the right.
ecolor: Color of the error bars.
Expand Down

0 comments on commit c0e9b49

Please sign in to comment.