Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to plot_seromodel #202

Closed
zmcucunuba opened this issue Aug 27, 2024 · 3 comments
Closed

Add options to plot_seromodel #202

zmcucunuba opened this issue Aug 27, 2024 · 3 comments

Comments

@zmcucunuba
Copy link
Member

zmcucunuba commented Aug 27, 2024

Is your feature request related to a problem? Please describe.
When using the plot_seromodel function with a constant model, the output is a single seroprevalence plot, rather than a plot showing age/time and r_hat. This makes it challenging to compare with other models using cowplot.

Describe the solution you'd like
It would be beneficial if the plot distribution in cowplot could be made consistent with other models. As I’m comparing it with a time-varying model, it would be more straightforward if the Force of Infection (FoI) remained constant over time for a better comparison.

Additional context

@ntorresd ntorresd changed the title plot_seromodel Add options to plot_seromodel Sep 9, 2024
@ntorresd
Copy link
Member

ntorresd commented Sep 9, 2024

Thanks for opening this issue, @zmcucunuba! This was raised by other users during our last user test. I agree this would be useful to facilitate model comparison.

For some context, a typical (time model) plot generated by means of plot_seromodel looks like:

image

However, when we plot the results from implementing the "constant" model:

seromodel <- fit_seromodel(
  serosurvey = serosurvey,
  model_type = "constant"
)
plot_seromodel(seromodel, serosurvey)

It looks like:

image

The reason for this is that, in the case of constant FOI models, we only estimate one value of the FOI and its corresponding R-hat, meaning that there is some ambiguity about whether to plot the constant FOI value as a function of age or time (e.g.):

image

The solution for this may be to add an option to plot_seromodel that enables this plot for the constant model case, plotting the FOI and the rhats as a function of time as default when some boolean is TRUE (plot_single_estimates):

plot_seromodel(
  seromodel = seromodel,
  serosurvey = serosurvey,
  plot_single_estimates = TRUE,
  single_estimates_x = "time"
  )

@zmcucunuba, please let me know what you think of this solution.

@ntorresd
Copy link
Member

ntorresd commented Sep 9, 2024

In #200 @ben18785 pointed out that users may want to suppress the summary at the top from the plot generated by plot_seromodel:

With the plotting, is there a way to suppress the written text at the top? I can imagine people wanting to put these into a publication and they may not want the written text.

This can easily be solved by adding an option to include it or not, such that:

plot_seromodel(
  seromodel = seromodel,
  serosurvey = serosurvey,
  plot_single_estimates = TRUE,
  include_summary = FALSE
  )

would return:

image

I want to address this here as its related to plot_seromodel options as well.

@ntorresd
Copy link
Member

Closed by #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants