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

PMpost object incorrectly generated #11

Closed
jjliupharmd opened this issue May 22, 2020 · 17 comments
Closed

PMpost object incorrectly generated #11

jjliupharmd opened this issue May 22, 2020 · 17 comments
Labels
bug Something isn't working

Comments

@jjliupharmd
Copy link

I have experienced some issues with plotting mdata (predicted conc.) in the new Pmetrics 1.9.3.

Essentially, I noticed that the post.xx lists generated were different despite using the same data and model file across 2 versions of Pmetrics (1.5.2 vs. 1.9.3),

As you can see in the attached screen capture, the post object generated in 1.9.3 has mean and median predicted levels specifically at observed time points + predicted levels at icen=NA with defined increments from hour 0, while the 1.5.3 output has, for the most part, mean/median/mode.

Capture

The other question is on the PMpost object in the 1.9.3 version - is that mean or median? Or mode? Since the values don't exactly match the output from 1.5.3.

Thanks!

@mnneely
Copy link
Contributor

mnneely commented May 22, 2020

This probably has to do with conversion from deprecated functions to tidyverse. Will look into it.

@mnneely mnneely added bug Something isn't working more information needed More information needs to be collected about these problems or feature requests (e.g. steps to repro labels May 22, 2020
@mnneely
Copy link
Contributor

mnneely commented May 27, 2020

@jjliupharmd Can you upload the NPAGout.Rdata file so I can test the code on your output?

@jjliupharmd
Copy link
Author

Oops... sorry closed your comment by accident. I am new to this GUI still.

I have attached the .rdata file here. I saw that this prob persists in 1.9.4.

Self note: this is my run 999 in temp folder.
NPAGout.zip

@jjliupharmd jjliupharmd reopened this May 27, 2020
@mnneely
Copy link
Contributor

mnneely commented May 27, 2020

Thanks. I forgot to ask for the PRTB0001 file as well. It will also be in the output folder.

@jjliupharmd
Copy link
Author

Thanks. I forgot to ask for the PRTB0001 file as well. It will also be in the output folder.

outputs.zip I am attaching both in the .zip file now. Thx!

@mnneely
Copy link
Contributor

mnneely commented May 27, 2020

Hmm, I think I fixed a bug, but I'm not even getting any of the same numbers as in your screen shot for 1.5.3. In the files you sent me, there is no prediction equal to 51.979 (the second row on 1.5.3 version) or even rounded to 52. Same for 85.729. Can you verify that you are using the exact same output files?

In contrast, in the files you sent, I can find the predictions you show in 1.9.3, which are mis-sorted in your screen shot due to the bug which I think I've now fixed. See my screenshot below.

image

@jjliupharmd
Copy link
Author

I noticed that too early on... and I am repeating the same run I did on 5/22 two more times now with the same files.. Will follow up.

@jjliupharmd
Copy link
Author

jjliupharmd commented May 28, 2020

Unfortunately, I might have had the files mixed up in the testing folder. But it looks like all 3 runs (1 from 5/22 and 2 from today) check out! @mnneely
Capture

@mnneely
Copy link
Contributor

mnneely commented May 28, 2020

So is your problem resolved? I also get the same values at 48 hours from the files you sent. The bug I found was related to data with >1 output, so not relevant to your problem. If it is resolved, I'll close the issue. Thanks!

@jjliupharmd
Copy link
Author

Yup! Resolved. I think can close now.

p.s. no hurry, but will there be an incremental update/fix for the PMpost object?

@mnneely
Copy link
Contributor

mnneely commented May 29, 2020

Ummm, I'm not sure how to understand your comment. We were working on PMpost in this issue and you just said it was resolved.

@jjliupharmd
Copy link
Author

Sorry for not being clear. When I said it was resolved because I was finally able to generate the same posterior-predicted concentration values across runs (since I may have used different data files in my original post, thus different numbers in the PMpost object in my original screenshot and orginally attached files). But this was secondary to my post.

My question is that if there will be a new version for the bug fix re: conversion from deprecated functions to tidyverse/sorting in PMpost object (attached screenshot). The posterior predicted values still carry NA for the "icen" column.

Capture2

@mnneely mnneely removed the more information needed More information needs to be collected about these problems or feature requests (e.g. steps to repro label May 29, 2020
@mnneely
Copy link
Contributor

mnneely commented May 29, 2020

OK, can you reinstall Pmetrics and try again? It seems to be working ok on my end.
In Rstudio, use the following:

devtools::install_github("LAPKB/Pmetrics")

@jjliupharmd
Copy link
Author

I think I have encountered a windows specific problem. I have manually removed the package folder (dplyr) multiple times and reinstalling and kept having the same Rd warning. Even re-installed the devtools along with rlang to make sure they are not at fault.

Just a snapshot of the example error message:

Rd warning: C:/Users/Jiajun Liu/AppData/Local/Temp/RtmpUzMXVM/R.INSTALL497c2662749a/dplyr/man/tidyeval-compat.Rd:25: file link 'expr' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: C:/Users/Jiajun Liu/AppData/Local/Temp/RtmpUzMXVM/R.INSTALL497c2662749a/dplyr/man/tidyeval-compat.Rd:26: file link 'enquo' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: C:/Users/Jiajun Liu/AppData/Local/Temp/RtmpUzMXVM/R.INSTALL497c2662749a/dplyr/man/tidyeval-compat.Rd:27: file link 'enquos' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: C:/Users/Jiajun Liu/AppData/Local/Temp/RtmpUzMXVM/R.INSTALL497c2662749a/dplyr/man/tidyeval-compat.Rd:29: file link 'syms' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: C:/Users/Jiajun Liu/AppData/Local/Temp/RtmpUzMXVM/R.INSTALL497c2662749a/dplyr/man/tidyeval-compat.Rd:31: file link 'quo' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: C:/Users/Jiajun Liu/AppData/Local/Temp/RtmpUzMXVM/R.INSTALL497c2662749a/dplyr/man/tidyeval-compat.Rd:32: file link 'quos' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: C:/Users/Jiajun Liu/AppData/Local/Temp/RtmpUzMXVM/R.INSTALL497c2662749a/dplyr/man/tidyeval-compat.Rd:33: file link 'quo_name' in package 'rlang' does not exist and so has been treated as a topic
Rd warning: C:/Users/Jiajun Liu/AppData/Local/Temp/RtmpUzMXVM/R.INSTALL497c2662749a/dplyr/man/tidyeval-compat.Rd:34: file link 'ensym' in package 'rlang' does not exist and so has been treated as a topic

Discussion here:
r-lib/roxygen2#707

Still trying to see how to solve this on windows platform. Not sure if I need to go back to older version of dplyr

@jjliupharmd
Copy link
Author

After multiple iterations of testing dplyr packages... I finally reinstalled the dplyr ver. 0.8.2 (oldest version supported by Pmetrics) and then re-installed devtools. After that, used the code you provided to install 1.9.4 branch. The output of PMpost is now correct! I attached the posterior output for reference.

At this point, I am really unclear if it's the newest dplyr package that's causing the issue. I am inclined to stay put with 0.8.2 since that's working on my end.

Thanks!

05292020.zip

@mnneely
Copy link
Contributor

mnneely commented May 29, 2020

Sorry for all the trouble. I'm running dplyr 0.8.5 if that helps. I'll mark this as closed, but we can always reopen if needed. The current release is 1.9.5 now.

@mnneely mnneely closed this as completed May 29, 2020
@jjliupharmd
Copy link
Author

No prob. Thx Michael!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants