UUPharmacometrics / xpose

Graphical diagnostics for pharmacometric models
https://uupharmacometrics.github.io/xpose
GNU Lesser General Public License v3.0
55 stars 28 forks source link

Error when X=DV format is used in nonmem $input #150

Closed Kagedal closed 5 years ago

Kagedal commented 5 years ago

If DV is defined in $input like this $INPUT ID PTNM TIME DV=X EVID....

To identify DV, I used this in xpose: xpdb =xpdb %>% set_var_types(dv="SLD",iwres = "CIWRES")

When running xpdb %>% dv_vs_ipred() I get Error: Discrete value supplied to continuous scale Not very easy to understand this error message since the plot was not at all using any categorical data.

I think that X is appanded to the CATAB table and xpose gets confused when there is a continuous variable in that table.

bguiastr commented 5 years ago

@Kagedal if DV is part of the catab table it is the expected behavior that it is considered a categorical covariate by xpose and thus converted to a factor. This also explains your ggplot2 error message. I advise that you place DV in sdtab instead. If you do not want to rerun the model you can manually fix the DV class with:

xpdb <- xpdb %>%
  mutate(DV = as.numeric(as.character(DV)))

Hope this help !

bguiastr commented 5 years ago

Please reopen if the problem remains