Skip to content

It seems the plots for population only modeling are lacking #30

@mattfidler

Description

@mattfidler
library(nlmixr2)
#> Loading required package: nlmixr2data
library(tidyverse)

set.seed(42)
rxode2::rxSetSeed(42)

iv1cmt <- function() {
  ini({
    tV <- 1
    tCL <- 0.2
    prop.err <- 0.1
  })
  model({
    V  <- tV
    CL <- tCL
    d/dt(X) = -(CL/V)*X
    cp = X/V
    cp ~ prop(prop.err)
  })
}

e <- et(amt=1000, rate=500) %>%
  et(0.1, 24, length.out=24)

dat <- rxode2::rxSolve(iv1cmt, e, addDosing = TRUE) 

dat <- dat %>%
  mutate(ID=1, DV=ifelse(is.na(amt), sim, NA)) %>%
  select(ID, evid, cmt, amt, rate, time, DV)

f <- nlmixr(iv1cmt)

fit <- nlmixr(f, dat, est="focei",
              control=list(print=0, outerOpt="bobyqa"))
#> rxode2 2.0.12 using 8 threads (see ?getRxThreads)
#>   no cache: create with `rxCreateCache()`
#> calculating covariance matrix
#> done
#> → Calculating residuals/tables
#> ✔ done
#> → compress origData in nlmixr2 object, save 2136
#> → compress parHist in nlmixr2 object, save 3088
plot(fit)

Created on 2023-03-23 with reprex v2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions