From 07346be10c96c25e3da77aa501eb1c9f08111afa Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Fri, 18 Oct 2024 12:37:29 -0500 Subject: [PATCH] Add babelBpopIdx --- NAMESPACE | 1 + man/babelBpopIdx.Rd | 71 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 man/babelBpopIdx.Rd diff --git a/NAMESPACE b/NAMESPACE index 562719b8..a751a813 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -144,6 +144,7 @@ export(as.nlmixr) export(as.nlmixr2) export(as.nonmem2rx) export(babel.poped.database) +export(babelBpopIdx) export(bblDatToMonolix) export(bblDatToMrgsolve) export(bblDatToNonmem) diff --git a/man/babelBpopIdx.Rd b/man/babelBpopIdx.Rd new file mode 100644 index 00000000..1210a249 --- /dev/null +++ b/man/babelBpopIdx.Rd @@ -0,0 +1,71 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/poped.R +\name{babelBpopIdx} +\alias{babelBpopIdx} +\title{Get the bpop_idx by variable name for a poped database created by \code{babelmixr2}} +\usage{ +babelBpopIdx(popedInput, var) +} +\arguments{ +\item{popedInput}{The babaelmixr2 created database} + +\item{var}{variable to query} +} +\value{ +index of the variable +} +\description{ +This may work for other poped databases if the population parameters are named. +} +\examples{ + +if (requireNamespace("PopED", quietly=TRUE)) { + +f <- function() { + ini({ + tV <- 72.8 + tKa <- 0.25 + tCl <- 3.75 + tF <- fix(0.9) + pedCL <- 0.8 + + eta.v ~ 0.09 + eta.ka ~ 0.09 + eta.cl ~0.25^2 + + prop.sd <- fix(sqrt(0.04)) + add.sd <- fix(sqrt(5e-6)) + + }) + model({ + V<-tV*exp(eta.v) + KA<-tKa*exp(eta.ka) * (pedCL**isPediatric) # add covariate for pediatrics + CL<-tCl*exp(eta.cl) + Favail <- tF + + N <- floor(t/TAU)+1 + y <- (DOSE*Favail/V)*(KA/(KA - CL/V)) * + (exp(-CL/V * (t - (N - 1) * TAU)) * + (1 - exp(-N * CL/V * TAU))/(1 - exp(-CL/V * TAU)) - + exp(-KA * (t - (N - 1) * TAU)) * (1 - exp(-N * KA * TAU))/(1 - exp(-KA * TAU))) + + y ~ prop(prop.sd) + add(add.sd) + }) +} + +e <- et(c( 1,8,10,240,245)) + +babel.db <- nlmixr2(f, e, "poped", + popedControl(m = 2, + groupsize=20, + bUseGrouped_xt=TRUE, + a=list(c(DOSE=20,TAU=24,isPediatric = 0), + c(DOSE=40, TAU=24,isPediatric = 0)))) + +babelBpopIdx(babel.db, "pedCL") + +} +} +\author{ +Matthew L. Fidler +}