Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Oct 15, 2024
1 parent dabd7b7 commit 036d3c6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/testthat/test-poped.R
Original file line number Diff line number Diff line change
Expand Up @@ -594,4 +594,33 @@ if (requireNamespace("PopED", quietly=TRUE)) {
## test_that("example 3", {

## })

test_that("PopED lhs", {

pheno <- function() {
ini({
tcl <- log(0.008) # typical value of clearance
tv <- log(0.6) # typical value of volume
## var(eta.cl)
eta.cl + eta.v ~ c(1,
0.01, 1) ## cov(eta.cl, eta.v), var(eta.v)
# interindividual variability on clearance and volume
add.err <- 0.1 # residual variability
})
model({
cl <- exp(tcl + eta.cl) # individual value of clearance
if (fed == 1)
cl <- cl*1.1
v <- exp(tv + eta.v) # individual value of volume
ke <- cl / v # elimination rate constant
d/dt(A1) = - ke * A1 # model differential equation
cp = A1 / v # concentration in plasma
cp ~ add(add.err) # define error model
})
}

p <- pheno()

expect_equal(eval(.popedRxModel(p))$lhs, c("rx_pred_", "rx_r_"))
})
}

0 comments on commit 036d3c6

Please sign in to comment.