Description:
Summary:
This issue proposes extending the plot_predicted_curve() function to overlay marginal (“new person”) model predictions for different strata (e.g., age groups) in the same panel. This will improve visualization of stratified model fits from SRM outputs.
Motivation:
-
Current implementation only supports conditional (individual-level) predictions.
-
Comparing marginal model fits across strata (e.g., <5 vs ≥5 years) on the same plot would help assess group-level differences in antibody kinetics.
-
Suggested by Sam and supported by Kristen and Ezra during the 07.30.2025 meeting.
Proposed Features:
-
Overlay median marginal curves for each stratum using different colors or line types.
-
Optionally overlay observed individual data in the background (optional).
-
Ensure compatibility with stratified SRM outputs (i.e., one new_person per stratum).
-
Maintain current behavior when no stratification is used.
Implementation Notes:
-
Separate logic for:
-
Add new arguments to control stratified marginal overlay (e.g., strat_overlay = TRUE)
-
Reuse logic from serocalculator or internal helpers to minimize duplication
Development Plan:
Description:
Summary:
This issue proposes extending the
plot_predicted_curve()function to overlay marginal (“new person”) model predictions for different strata (e.g., age groups) in the same panel. This will improve visualization of stratified model fits from SRM outputs.Motivation:
Current implementation only supports conditional (individual-level) predictions.
Comparing marginal model fits across strata (e.g.,
<5vs≥5years) on the same plot would help assess group-level differences in antibody kinetics.Suggested by Sam and supported by Kristen and Ezra during the 07.30.2025 meeting.
Proposed Features:
Overlay median marginal curves for each stratum using different colors or line types.
Optionally overlay observed individual data in the background (optional).
Ensure compatibility with stratified SRM outputs (i.e., one
new_personper stratum).Maintain current behavior when no stratification is used.
Implementation Notes:
Separate logic for:
Observed data(optional)Marginal predicted valuesfromnew_personAdd new arguments to control stratified marginal overlay (e.g.,
strat_overlay = TRUE)Reuse logic from
serocalculatoror internal helpers to minimize duplicationDevelopment Plan:
Implement in a new PR, separate from PR Add multi-ID faceting support to plot_predicted_curve and update tests/examples #120
Collaborate with Sam and Kristen for design and review
Add visual test cases with multiple strata