Learn R Programming

mrgsolve (version 0.8.9)

pkmodel: Simulate from 1- or 2-compartment PK model.

Description

This is an R function that returns model objects based on $PKMODEL.

Usage

pkmodel(ncmt = 1, depot = FALSE, ...)

Arguments

ncmt

passed to PKMODEL

depot

passed to PKMODEL

...

passed to update

Value

An object of class mrgmod-class

Details

Once the model object is generated, use param to check names of the parameters in the model and init to check the names of the compartments in the model. Calculations for the amounts in each compartment are done via analytical solutions, not differential equations. A subject-level random effect is also provided for each PK parameter; use omat to see the names of those random effects. All random effect variances have initial value of zero and may be updated via omat.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
mod <- pkmodel(1)

mod %>% ev(amt=1000, ii=24, addl=3) %>% mrgsim(end=120)
mod <- pkmodel(1,TRUE)
mod <- pkmodel(2)
mod <- pkmodel(2,TRUE)

# }
# NOT RUN {



# }

Run the code above in your browser using DataLab