-
Notifications
You must be signed in to change notification settings - Fork 3
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
xpose.nlmixr does not capture all of the data #6
Comments
As part of the upcoming initiative to make xpose S3 compatible, I will also try to contribute to xpose.nlmixr and bring it up to speed. |
Thank you @guiastrennec; Its much appreciated. |
Hi Dr.@mattfidler I am not sure if we are talking about the same problem. I was using the latest nlmixr 1.0.0.8 on github and wanted to use the function |
Thanks @guiastrennec! @DedeLLL, I'll look into your issue as well. |
Thanks so much! @kestrel99 :) |
Hi @DedeLLL it seems like a different issue. Was there any warnings after fitting the data, like |
Hi @mattfidler @kestrel99 Thanks for your time, I actually used the example from the nlmixr package help document. > d <- Oral_1CPT
d <- d[,names(d) != "SS"]
f <- function(){
ini({
lCl <- 1.6
lVc <- log(90)
lKA <- 0.1
prop.err <- c(0, 0.2, 1)
eta.Cl ~ 0.1
eta.Vc ~ 0.1
eta.KA ~ 0.1
})
model({
Cl <- exp(lCl + eta.Cl)
Vc = exp(lVc + eta.Vc)
KA <- exp(lKA + eta.KA)
kel <- Cl / Vc;
d/dt(depot) = -KA*depot;
d/dt(centr) = KA*depot-kel*centr;
cp = centr / Vc;
cp ~ prop(prop.err)
})
}
fit.s <- nlmixr(f,d,est="saem",control=saemControl(n.burn=50,n.em=100,print=50)) The result I got was Warning message:
In (function (uif, data, est = NULL, control = list(), ..., sum.prod = FALSE, :
Bounds are ignored in SAEM This was the only warning I got. fit.s <- addCwres(fit.s)
a<-xpose_data_nlmixr(fit.s) I got the error Error in data.frame(data_a, full.dat) :
arguments imply differing number of rows: 6960, 6947` |
Also I tried another dataset from the help document of nlmixr. |
Hi @DedeLLL , I believe your issues have been addressed. Please update RxODE, nlmixr and xpose.nlmixr. Here is my example and the results: library(nlmixr)
library(xpose.nlmixr)
#> Loading required package: xpose
#> Loading required package: ggplot2
#>
#> Attaching package: 'xpose'
#> The following object is masked from 'package:nlmixr':
#>
#> vpc
#> The following object is masked from 'package:stats':
#>
#> filter
#>
#> Attaching package: 'xpose.nlmixr'
#> The following object is masked from 'package:nlmixr':
#>
#> vpc
d <- Oral_1CPT;
d <- d[d$ID %in% unique(d$ID)[1:12], ]
# d <- d[,names(d) != "SS"] ## SS supported in RxODE/nlmixr now
f <- function(){
ini({
lCl <- 1.6
lVc <- log(90)
lKA <- 0.1
prop.err <- c(0, 0.2, 1)
eta.Cl ~ 0.1
eta.Vc ~ 0.1
eta.KA ~ 0.1
})
model({
Cl <- exp(lCl + eta.Cl)
Vc = exp(lVc + eta.Vc)
KA <- exp(lKA + eta.KA)
kel <- Cl / Vc;
d/dt(depot) = -KA*depot;
d/dt(centr) = KA*depot-kel*centr;
cp = centr / Vc;
cp ~ prop(prop.err)
})
}
fit.s <- nlmixr(f,d,est="saem",control=saemControl(n.burn=50,n.em=100,print=50))
#> Warning in (function (uif, data, est = NULL, control = list(), ...,
#> sum.prod = FALSE, : Bounds are ignored in SAEM
#> Compiling RxODE equations...
#> done.
#> 1: 1.8670 4.5645 0.0235 0.0950 0.0964 0.0950 0.5929
#> 50: 1.4771 4.1704 0.0226 0.0873 0.1208 0.1207 0.2014
#> 100: 1.4764 4.1758 0.0076 0.0906 0.1233 0.1194 0.2015
#> 150: 1.4737 4.1723 0.0045 0.0890 0.1263 0.1182 0.2009
#> Calculating residuals/tables
#> done.
xpdb <- xpose_data_nlmixr(fit.s)
#> Calculating residuals/tables
#> done.
#> Warning in xpose_data_nlmixr(fit.s): Added CWRES to fit (using
#> nlmixr::addCwres)
dv_vs_pred(xpdb) Created on 2019-04-07 by the reprex package (v0.2.1) |
It works! Thanks sooooooo much @mattfidler for your precious time and effort. By the way, I updated all the new packages for macOSX and it also worked really well. (The previous versions could not work on my mac although I checked my clang and gfortran to be the latest version) That is a real bonus! |
Great! I'm glad to hear it. |
There seems to be a problem importing data into xpose; Some of the data isn't captured.
See:
UUPharmacometrics/xpose#154
This can be useful in:
https://github.com/nlmixrdevelopment/nlmixr-examples/blob/master/case-study-warfarin/warfarin_PKPD_joint.R
@kestrel99 do you have any idea on this? It shouldn't be hard to be implement?
The text was updated successfully, but these errors were encountered: