tests/testthat/test_calc_kel_single_tdm.R

test_that("estimation of elimination rate", {
  dose <- 1000
  V <- 50
  kel <- 0.1
  CL <- kel * V
  conc <- pk_1cmt_inf_ss(
    t = 10,
    dose = 1000,
    tau = 12,
    t_inf = 1,
    CL = CL,
    V = V
  )
  kel_est <- calc_kel_single_tdm(
    dose = 1000,
    V = 50,
    t = 10,
    dv = 11.07,
    tau = 12,
    t_inf = 1,
    kel_init = .1,
    n_iter = 20
  )
  expect_true(abs(kel_est - kel)/kel < 0.05)
})

Try the clinPK package in your browser

Any scripts or data that you put into this service are public.

clinPK documentation built on May 9, 2022, 9:06 a.m.