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

Multiple endpoint support? #154

Open
mattfidler opened this issue Mar 29, 2019 · 5 comments
Open

Multiple endpoint support? #154

mattfidler opened this issue Mar 29, 2019 · 5 comments

Comments

@mattfidler
Copy link

Hi @guiastrennec,

I couldn't find information about multiple-endpoint plots. It should be possible but I'm unsure if it is present yet.

I was going to provide a nlmixr example with multiple endpoints and use xpose plots and realized I didn't know how to specify multiple endpoints.

Best
Matt

PS, have you ever got around to making vpc a s3 method since other people use the same function.

@bguiastr
Copy link
Collaborator

@mattfidler I am not familiar with the term "multiple-endpoint plots" could you please be more specific?

Regarding S3 I unfortunately did not yet have the time but it is on my todo list and more than vpc it will be the entire package that will be rewritten this way. The idea is to facilitate integration with NLMIXR for example

@mattfidler
Copy link
Author

For example stratifying by endpoints in a parent-metabolite model. Or stratifying by endpoints in a PK/PD example like:

https://github.com/nlmixrdevelopment/nlmixr-examples/blob/master/case-study-warfarin/warfarin_PKPD_joint.R

Here I wanted to plot by PK and PD endpoints for the simultaneous fit.

Thanks for the update on S3. This seems like a major refactoring.

@mattfidler
Copy link
Author

@bguiastr
Copy link
Collaborator

bguiastr commented Apr 1, 2019

@mattfidler thanks for the examples, now I understand what you want to achieve (my apologies for the confusion)!

In the case of the parent-metabolite model or continuous PK/PD models you can easily stratify the plot based on a variable (i.e. usually DVID in NONMEM).

  1. You can define this variable on a plot by plot basis with the facet argument e.g.
xpdb_ex_pk %>% dv_vs_ipred(facet = ~SEX)
  1. You can also define the faceting globally in the xpose_theme and all plots using this xpdb will automatically be stratified e.g.
xpdb_2 <- xpdb_ex_pk %>%
 update_themes(xp_theme = list(facets = ~SEX))

xpdb_2 %>% dv_vs_ipred()

In the case of a PK/PD model where the PD is categorical, you would have to plot the PK and the PD separately. Note that I do not intend to create plots handling this type scenarios, I want xpose to remain highly modular and simple. This is why we implemented methods around the dplyr verbs for the xpdb, this allows you to modify the xpdb to your need (e.g. by filtering and creating factors).

I hope this helps!

@mattfidler
Copy link
Author

Indeed it does give me an idea of what is possible. I don't think xpose.nlmixr captures this information currently. I have opened up a issue there.

I'm not sure if you want to keep this issue open to include documentation about this feature.

Also I'm assuming a plain facet_wrap would work since it is a ggplot?

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

No branches or pull requests

2 participants