Replies: 1 comment 4 replies
-
|
You are right, since You can delete anything inside the model by:
In the case of nlmixr2/rxode2 5.0 this is simply changing the object from a list to a environment, but in earlier versions this was changing binary to environment. A version compatible method to do this is below: library(nlmixr2)
#> ── Attaching packages ───────────────────────────────────────── nlmixr2 5.0.0 ──
#> ✔ lotri 1.0.2 ✔ monolix2rx 0.0.6
#> ✔ nlmixr2data 2.0.9 ✔ nlmixr2lib 0.3.1
#> ✔ nlmixr2est 5.0.0 ✔ nlmixr2rpt 0.2.2
#> ✔ nlmixr2extra 5.0.0 ✔ nonmem2rx 0.1.8
#> ✔ nlmixr2plot 5.0.0 ✔ posologyr 1.2.8
#> ✔ rxode2 5.0.0 ✔ shinyMixR 0.5.2
#> ✔ babelmixr2 0.1.9 ✔ xpose.nlmixr2 0.4.1
#> ✔ ggPMX 1.3.2
#> ── Optional Packages Loaded/Ignored ─────────────────────────── nlmixr2 5.0.0 ──
#> ✔ babelmixr2 ✔ nonmem2rx
#> ✔ ggPMX ✔ posologyr
#> ✔ monolix2rx ✔ shinyMixR
#> ✔ nlmixr2lib ✔ xpose.nlmixr2
#> ✔ nlmixr2rpt
#> ── Conflicts ───────────────────────────────────────────── nlmixr2conflicts() ──
#> ✖ rxode2::boxCox() masks nlmixr2est::boxCox()
#> ✖ rxode2::yeoJohnson() masks nlmixr2est::yeoJohnson()
one.cmt <- function() {
thetaMat <- lotri(tka +tcl ~ c(1,
0.05, 1))
ini({
## You may label each parameter with a comment
tka <- 0.45 # Log Ka
tcl <- log(c(0, 2.7, 100)) # Log Cl
## This works with interactive models
## You may also label the preceding line with label("label text")
tv <- 3.45; label("log V")
## the label("Label name") works with all models
eta.ka ~ 0.6
eta.cl ~ 0.3
eta.v ~ 0.1
add.sd <- 0.7
})
model({
ka <- exp(tka + eta.ka)
cl <- exp(tcl + eta.cl)
v <- exp(tv + eta.v)
linCmt() ~ add(add.sd)
})
}
f <- one.cmt()
f$thetaMat
#> tka tcl
#> tka 1.00 0.05
#> tcl 0.05 1.00
f <- rxUiDecompress(f) # don't know if this is needed for 5.0
rm("thetaMat", envir=f$meta)
f <- rxUiCompress(f)
f$thetaMat
#> NULL
fCreated on 2025-12-02 with reprex v2.1.1 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm combining two different models from nonmem outputs. Each of them is a PK/PD model. Model 1 tracks PD1, and model 2 track PD2. Both are using post hoc estimates for the PK portion and are the same. I've used nonmem2rx to read in and valiate both independently. What is the best way to combine these models to simulate based on post hoc estimates?
What I tried:
I think this should work but I'm getting the following error:
Since I'm using post hoc estimates, I don't think I need the thetaMat. Can I delete it? How do I do that?
Alternative, is there a better way to merge PKPD2?
Beta Was this translation helpful? Give feedback.
All reactions