diff --git a/R/dosing_optim.R b/R/dosing_optim.R index dd0f106..5264188 100644 --- a/R/dosing_optim.R +++ b/R/dosing_optim.R @@ -16,10 +16,10 @@ # along with this program. If not, see . #------------------------------------------------------------------------- -#' Predict time to a selected trough concentration +#' Estimate the time required to reach a target trough concentration (Cmin) #' -#' Predicts the time needed to reach a selected trough concentration -#' (Cmin) given a population pharmacokinetic model, a set of individual +#' Estimates the time required to reach a target trough concentration (Cmin) +#' given a population pharmacokinetic model, a set of individual #' parameters, a dose, and a target Cmin. #' #' @param dat Dataframe. An individual subject dataset following the @@ -314,12 +314,12 @@ poso_time_cmin <- function(dat=NULL,prior_model=NULL,tdm=FALSE, return(time_cmin) } -#' Estimate the optimal dose for a selected target area under the -#' time-concentration curve (AUC) +#' Estimate the dose needed to reach a target area under the concentration-time +#' curve (AUC) #' -#' Estimates the optimal dose for a selected target area under the -#' time-concentration curve (AUC) given a population pharmacokinetic -#' model, a set of individual parameters, and a target AUC. +#' estimates the dose needed to reach a target area under the concentration-time +#' curve (AUC) given a population pharmacokinetic model, a set of individual +#' parameters, and a target AUC. #' #' @param dat Dataframe. An individual subject dataset following the #' structure of NONMEM/rxode2 event records. @@ -640,12 +640,11 @@ poso_dose_auc <- function(dat=NULL,prior_model=NULL,tdm=FALSE, return(dose_auc) } -#' Estimate the optimal dose for a selected target concentration +#' Estimate the optimal dose to achieve a target concentration at any given time #' -#' Estimates the optimal dose for a selected target concentration at a -#' selected point in time given a population pharmacokinetic model, a set -#' of individual parameters, a selected point in time, and a target -#' concentration. +#' Estimates the optimal dose to achieve a target concentration at any given +#' time given a population pharmacokinetic model, a set of individual +#' parameters, a selected point in time, and a target concentration. #' #' @param dat Dataframe. An individual subject dataset following the #' structure of NONMEM/rxode2 event records. @@ -942,13 +941,12 @@ poso_dose_conc <- function(dat=NULL,prior_model=NULL,tdm=FALSE, return(dose_conc) } -#' Estimate the optimal inter-dose interval for a given dose and a -#' selected target trough concentration +#' Estimate the optimal dosing interval to consistently achieve a target trough +#' concentration (Cmin) #' -#' Estimates the optimal inter-dose interval for a selected target -#' trough concentration (Cmin), given a dose, a population -#' pharmacokinetic model, a set of individual parameters, and a -#' target concentration. +#' Estimates the optimal dosing interval to consistently achieve a target Cmin, +#' given a dose, a population pharmacokinetic model, a set of individual +#' parameters, and a target concentration. #' #' @param dat Dataframe. An individual subject dataset following the #' structure of NONMEM/rxode2 event records. diff --git a/docs/reference/index.html b/docs/reference/index.html index 262bf09..dbb8633 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -63,25 +63,25 @@

Dose optimization functionsposo_dose_auc() -
Estimate the optimal dose for a selected target area under the time-concentration curve (AUC)
+
Estimate the dose needed to reach a target area under the concentration-time curve (AUC)
poso_dose_conc()
-
Estimate the optimal dose for a selected target concentration
+
Estimate the optimal dose to achieve a target concentration at any given time
poso_time_cmin()
-
Predict time to a selected trough concentration
+
Estimate the time required to reach a target trough concentration (Cmin)
poso_inter_cmin()
-
Estimate the optimal inter-dose interval for a given dose and a selected target trough concentration
+
Estimate the optimal dosing interval to consistently achieve a target trough concentration (Cmin)

Estimation functions

diff --git a/docs/reference/poso_dose_auc.html b/docs/reference/poso_dose_auc.html index db630fc..27a5ed5 100644 --- a/docs/reference/poso_dose_auc.html +++ b/docs/reference/poso_dose_auc.html @@ -1,9 +1,9 @@ -Estimate the optimal dose for a selected target area under the time-concentration curve (AUC) — poso_dose_auc • posologyr +Estimate the dose needed to reach a target area under the concentration-time curve (AUC) — poso_dose_auc • posologyr Skip to contents @@ -48,15 +48,15 @@
-

Estimates the optimal dose for a selected target area under the -time-concentration curve (AUC) given a population pharmacokinetic -model, a set of individual parameters, and a target AUC.

+

estimates the dose needed to reach a target area under the concentration-time +curve (AUC) given a population pharmacokinetic model, a set of individual +parameters, and a target AUC.

diff --git a/docs/reference/poso_dose_conc.html b/docs/reference/poso_dose_conc.html index c538e2f..62d6d54 100644 --- a/docs/reference/poso_dose_conc.html +++ b/docs/reference/poso_dose_conc.html @@ -1,11 +1,9 @@ -Estimate the optimal dose for a selected target concentration — poso_dose_conc • posologyr +Estimate the optimal dose to achieve a target concentration at any given time — poso_dose_conc • posologyr Skip to contents @@ -50,16 +48,15 @@
-

Estimates the optimal dose for a selected target concentration at a -selected point in time given a population pharmacokinetic model, a set -of individual parameters, a selected point in time, and a target -concentration.

+

Estimates the optimal dose to achieve a target concentration at any given +time given a population pharmacokinetic model, a set of individual +parameters, a selected point in time, and a target concentration.

diff --git a/docs/reference/poso_inter_cmin.html b/docs/reference/poso_inter_cmin.html index ff5e765..8d4ac1c 100644 --- a/docs/reference/poso_inter_cmin.html +++ b/docs/reference/poso_inter_cmin.html @@ -1,11 +1,9 @@ -Estimate the optimal inter-dose interval for a given dose and a selected target trough concentration — poso_inter_cmin • posologyr +Estimate the optimal dosing interval to consistently achieve a target trough concentration (Cmin) — poso_inter_cmin • posologyr Skip to contents @@ -50,16 +48,15 @@
-

Estimates the optimal inter-dose interval for a selected target -trough concentration (Cmin), given a dose, a population -pharmacokinetic model, a set of individual parameters, and a -target concentration.

+

Estimates the optimal dosing interval to consistently achieve a target Cmin, +given a dose, a population pharmacokinetic model, a set of individual +parameters, and a target concentration.

diff --git a/docs/reference/poso_time_cmin.html b/docs/reference/poso_time_cmin.html index b29a815..08d0203 100644 --- a/docs/reference/poso_time_cmin.html +++ b/docs/reference/poso_time_cmin.html @@ -1,8 +1,8 @@ -Predict time to a selected trough concentration — poso_time_cmin • posologyrEstimate the time required to reach a target trough concentration (Cmin) — poso_time_cmin • posologyr Skip to contents @@ -48,14 +48,14 @@
-

Predicts the time needed to reach a selected trough concentration -(Cmin) given a population pharmacokinetic model, a set of individual +

Estimates the time required to reach a target trough concentration (Cmin) +given a population pharmacokinetic model, a set of individual parameters, a dose, and a target Cmin.

@@ -276,8 +276,8 @@

Examples#> [1] 2.489933 #> #> $indiv_param -#> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka -#> 1 4 70 1 0.2236068 0.6019037 -0.4291733 0.127848 +#> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka +#> 1 4 70 1 0.2236068 0.6019036 -0.4291735 0.1278478 #>

diff --git a/docs/search.json b/docs/search.json index a0aeb9f..d76c8e5 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU Affero General Public License","title":"GNU Affero General Public License","text":"Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc.  Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU Affero General Public License","text":"GNU Affero General Public License free, copyleft license software kinds works, specifically designed ensure cooperation community case network server software. licenses software practical works designed take away freedom share change works. contrast, General Public Licenses intended guarantee freedom share change versions program–make sure remains free software users. speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. Developers use General Public Licenses protect rights two steps: (1) assert copyright software, (2) offer License gives legal permission copy, distribute /modify software. secondary benefit defending users’ freedom improvements made alternate versions program, receive widespread use, become available developers incorporate. Many developers free software heartened encouraged resulting cooperation. However, case software used network servers, result may fail come . GNU General Public License permits making modified version letting public access server without ever releasing source code public. GNU Affero General Public License designed specifically ensure , cases, modified source code becomes available community. requires operator network server provide source code modified version running users server. Therefore, public use modified version, publicly accessible server, gives public access source code modified version. older license, called Affero General Public License published Affero, designed accomplish similar goals. different license, version Affero GPL, Affero released new version Affero GPL permits relicensing license. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions.","title":"GNU Affero General Public License","text":"“License” refers version 3 GNU Affero General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code.","title":"GNU Affero General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions.","title":"GNU Affero General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law.","title":"GNU Affero General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies.","title":"GNU Affero General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions.","title":"GNU Affero General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: work must carry prominent notices stating modified , giving relevant date. work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms.","title":"GNU Affero General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms.","title":"GNU Affero General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: Disclaiming warranty limiting liability differently terms sections 15 16 License; Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; Limiting use publicity purposes names licensors authors material; Declining grant rights trademark law use trade names, trademarks, service marks; Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination.","title":"GNU Affero General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies.","title":"GNU Affero General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients.","title":"GNU Affero General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents.","title":"GNU Affero General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom.","title":"GNU Affero General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_13-remote-network-interaction-use-with-the-gnu-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Remote Network Interaction; Use with the GNU General Public License.","title":"GNU Affero General Public License","text":"Notwithstanding provision License, modify Program, modified version must prominently offer users interacting remotely computer network (version supports interaction) opportunity receive Corresponding Source version providing access Corresponding Source network server charge, standard customary means facilitating copying software. Corresponding Source shall include Corresponding Source work covered version 3 GNU General Public License incorporated pursuant following paragraph. Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU General Public License single combined work, convey resulting work. terms License continue apply part covered work, work combined remain governed version 3 GNU General Public License.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License.","title":"GNU Affero General Public License","text":"Free Software Foundation may publish revised /new versions GNU Affero General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU Affero General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU Affero General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU Affero General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty.","title":"GNU Affero General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability.","title":"GNU Affero General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16.","title":"GNU Affero General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"A posteriori dose selection","text":"Dosage individualization critical care patient treated amikacin suspected ventilator-associated pneumonia, using population pharmacokinetic (ppk) model Burdet et al. 2015, using data therapeutic drug monitoring (TDM).","code":"mod_amikacin_Burdet2015 <- function() { ini({ THETA_Cl=4.3 THETA_Vc=15.9 THETA_Vp=21.4 THETA_Q=12.1 ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.1, 0.01 , 0.05 , 0.01 , 0.02 , 0.2 , -0.06 , 0.004, 0.003, 0.08) add_sd <- 0.2 prop_sd <- 0.1 }) model({ TVCl = THETA_Cl*(CLCREAT4H/82)^0.7 TVVc = THETA_Vc*(TBW/78)^0.9*(PoverF/169)^0.4 TVVp = THETA_Vp TVQ = THETA_Q Cl = TVCl*exp(ETA_Cl) Vc = TVVc*exp(ETA_Vc) Vp = TVVp*exp(ETA_Vp) Q = TVQ *exp(ETA_Q) ke = Cl/Vc k12 = Q/Vc k21 = Q/Vp Cp = centr/Vc d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"patient-record-with-tdm-data","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Patient record with TDM data","title":"A posteriori dose selection","text":"first administration, dosage selection can refined using results TDM. See vignette(\"patient_data_input\") details regarding patient record. concentration measured 30 min 30 min infusion meet target peak concentration; < 60 mg/L.","code":"df_patientA <- data.frame(ID=1,TIME=c(0,1,6), DV=c(NA,58,14), EVID=c(1,0,0), AMT=c(2000,0,0), DUR=c(0.5,NA,NA), CLCREAT4H=50,TBW=62,PoverF=169) df_patientA #> ID TIME DV EVID AMT DUR CLCREAT4H TBW PoverF #> 1 1 0 NA 1 2000 0.5 50 62 169 #> 2 1 1 58 0 0 NA 50 62 169 #> 3 1 6 14 0 0 NA 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"estimate-the-map-individual-parameters","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Estimate the MAP individual parameters","title":"A posteriori dose selection","text":"maximum posteriori (MAP) individual parameters estimated.","code":"patA_map <- poso_estim_map(dat=df_patientA, prior_model=mod_amikacin_Burdet2015)"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"plot-the-individual-pharmacokinetic-profile","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Plot the individual pharmacokinetic profile","title":"A posteriori dose selection","text":"individual pharmacokinetic profile can plotted using rxode2 model provided poso_estim_map() function.","code":"plot(patA_map$model,Cc)"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"time-required-to-reach-the-target-cmin-following-the-first-administration","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Time required to reach the target Cmin following the first administration","title":"A posteriori dose selection","text":"MAP estimates individual parameters, prediction time needed reaching target Cmin can updated. next dose (needed) can administered 33.9 hours following first infusion.","code":"poso_time_cmin(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, tdm = TRUE, target_cmin = 2.5) #> $time #> [1] 33.9 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $cmin_estimate #> [1] 2.487865 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 3 4.3 15.9 21.4 12.1 0.2 0.1 0.4499479 0.2730561 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 3 0.7061648 -0.13884 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"optimal-dose-selection-a-posteriori","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Optimal dose selection a posteriori","title":"A posteriori dose selection","text":"optimal dose achieve peak concentration 80 mg/l can determined using MAP estimates. next dose 2450 mg.","code":"map_dose <- poso_dose_conc(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, tdm=TRUE, time_c = 35, #target concentration at t = 35 h time_dose = 34, #dosing at t = 34 h duration = 0.5, target_conc = 80) map_dose #> $dose #> [1] 2447.917 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 80 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 3 4.3 15.9 21.4 12.1 0.2 0.1 0.4499608 0.2730596 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 3 0.7061496 -0.1388505 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"interdose-interval-selection-a-posteriori","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Interdose interval selection a posteriori","title":"A posteriori dose selection","text":"optimal inter-dose interval reach Cmin 2.5 mg/L dosing can determined using MAP estimates. interval doses less 38.6 hours allow adequate elimination amikacin infusion.","code":"map_interval <- poso_inter_cmin(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, dose = map_dose$dose, duration = 0.5, target_cmin = 2.5) map_interval #> $interval #> [1] 38.57781 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 2.500173 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 1 4.3 15.9 21.4 12.1 0.2 0.1 0.449952 0.2730587 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 1 0.7061588 -0.1388432 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"A priori dose selection","text":"First dose selection critical care patient treated amikacin suspected ventilator-associated pneumonia. Population pharmacokinetic (ppk) model form Burdet et al. 2015.","code":"mod_amikacin_Burdet2015 <- function() { ini({ THETA_Cl=4.3 THETA_Vc=15.9 THETA_Vp=21.4 THETA_Q=12.1 ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.1, 0.01 , 0.05 , 0.01 , 0.02 , 0.2 , -0.06 , 0.004, 0.003, 0.08) add_sd <- 0.2 prop_sd <- 0.1 }) model({ TVCl = THETA_Cl*(CLCREAT4H/82)^0.7 TVVc = THETA_Vc*(TBW/78)^0.9*(PoverF/169)^0.4 TVVp = THETA_Vp TVQ = THETA_Q Cl = TVCl*exp(ETA_Cl) Vc = TVVc*exp(ETA_Vc) Vp = TVVp*exp(ETA_Vp) Q = TVQ *exp(ETA_Q) ke = Cl/Vc k12 = Q/Vc k21 = Q/Vp Cp = centr/Vc d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"patient-record","dir":"Articles","previous_headings":"A priori dose selection","what":"Patient record","title":"A priori dose selection","text":"first administration, concentration information available. patient record contains information required fill covariates model: CLCREAT4H: 4-h creatinine clearance ml/min TBW: Total body weight kg PoverF: PaO2/FIO2 ratio mmHg","code":"df_patientA <- data.frame(ID=1,TIME=0, DV=0, EVID=0, AMT=0, CLCREAT4H=50,TBW=62,PoverF=169) df_patientA #> ID TIME DV EVID AMT CLCREAT4H TBW PoverF #> 1 1 0 0 0 0 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"optimal-dose-selection","dir":"Articles","previous_headings":"A priori dose selection","what":"Optimal dose selection","title":"A priori dose selection","text":"absence measured concentrations, optimal dose mg achieve concentration 80 mg/l one hour start 30-minute infusion determined typical profile ppk model.","code":"prior_dose <- poso_dose_conc(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, time_c = 1, #30 min after a duration = 0.5, #30 min infusion target_conc = 80) prior_dose #> $dose #> [1] 2087.669 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 80 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 1 4.3 15.9 21.4 12.1 0.2 0.1 2.025724e-07 6.573817e-08 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 1 2.011353e-07 -1.163665e-07 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"time-required-to-reach-the-target-cmin","dir":"Articles","previous_headings":"A priori dose selection","what":"Time required to reach the target Cmin","title":"A priori dose selection","text":"Following dose, time hours required reach target Cmin concentration 2.5 mg/l can estimated.","code":"poso_time_cmin(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, dose = prior_dose$dose, duration = 0.5, #30 min infusion target_cmin = 2.5) #> $time #> [1] 37.5 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $cmin_estimate #> [1] 2.49637 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 1 4.3 15.9 21.4 12.1 0.2 0.1 -9.803026e-07 3.556777e-07 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 1 -3.567767e-07 9.847164e-07 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"plotting-the-selected-dosage","dir":"Articles","previous_headings":"A priori dose selection","what":"Plotting the selected dosage","title":"A priori dose selection","text":"selected dose can simulated plotted. setting n_simul = 0, poso_simu_pop() function produces compiled rxode2 model without inter-individual variability, using typical population parameter values individual covariates patient record. Observations 30-minutes infusion optimal dose added rxode2 model updating rxode2 event table. Plotting simulated scenario. resulting plot can augmented ggplot2. example, adding horizontal ribbon showing 60-80 mg/l target interval 1 h peak concentration, vertical dashed line marking 1 hour. typical patient (.e. PK profile typical model population), selected dose meets peak concentration target.","code":"# generate a model using the individual covariates simu_patA <- poso_simu_pop(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, n_simul = 0) simu_patA$model$time <- seq(0,20,b=0.1) simu_patA$model$add.dosing(dose=prior_dose$dose,rate=prior_dose$dose/0.5) plot(simu_patA$model,Cc) plot(simu_patA$model,Cc) + ggplot2::ylab(\"Central concentration\") + ggplot2::geom_vline(xintercept=1, linetype=\"dashed\") + ggplot2::geom_ribbon(ggplot2::aes(ymin=60, ymax=80), fill=\"seagreen\",show.legend = FALSE, alpha=0.15)"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"AUC-based dose selection","text":"AUC-based dosage adjustment patient treated vancomycin methicillin-resistant Staphylococcus aureus blood stream infection, using population pharmacokinetic (ppk) model Goti et al. 2018, using data therapeutic drug monitoring (TDM).","code":"mod_vancomycin_Goti2018 <- function() { ini({ THETA_Cl <- 4.5 THETA_Vc <- 58.4 THETA_Vp <- 38.4 THETA_Q <- 6.5 ETA_Cl ~ 0.147 ETA_Vc ~ 0.510 ETA_Vp ~ 0.282 add.sd <- 3.4 prop.sd <- 0.227 }) model({ TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) <- Cc Cc ~ add(add.sd) + prop(prop.sd) + combined1() }) }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"patient-record-with-tdm-data","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Patient record with TDM data","title":"AUC-based dose selection","text":"dosage selection can informed using results TDM. See vignette(\"patient_data_input\") details regarding patient records.","code":"df_patientB <- data.frame(ID=1,TIME=c(0.0,13.0,24.2,48), DV=c(NA,12,NA,9.5), AMT=c(2000,0,1000,0), DUR=c(2,NA,2,NA), EVID=c(1,0,1,0), CLCREAT=65,WT=70,DIAL=0) df_patientB #> ID TIME DV AMT DUR EVID CLCREAT WT DIAL #> 1 1 0.0 NA 2000 2 1 65 70 0 #> 2 1 13.0 12.0 0 NA 0 65 70 0 #> 3 1 24.2 NA 1000 2 1 65 70 0 #> 4 1 48.0 9.5 0 NA 0 65 70 0"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"estimate-the-map-individual-parameters","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Estimate the MAP individual parameters","title":"AUC-based dose selection","text":"","code":"patB_map <- poso_estim_map(dat=df_patientB, prior_model=mod_vancomycin_Goti2018)"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"plot-the-individual-pharmacokinetic-profile","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Plot the individual pharmacokinetic profile","title":"AUC-based dose selection","text":"individual pharmacokinetic profile can plotted using rxode2 model provided poso_estim_map() function. Using ggplot2 observed data points can added plot MAP profile matches observations.","code":"plot(patB_map$model,Cc) #Get the observations from the patient record indiv_obs <- df_patientB[,c(\"DV\",\"TIME\")] names(indiv_obs) <- c(\"value\",\"time\") #Overlay the MAP profile and the observations plot(patB_map$model,Cc) + ggplot2::ylab(\"Central concentration\") + ggplot2::geom_point(data=indiv_obs, size= 3, na.rm=TRUE)"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"get-the-auc24-from-the-map-model","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Get the AUC24 from the MAP model","title":"AUC-based dose selection","text":"Considering MIC 1 mg/L, target AUC 24 hours (AUC24) 400 mg.h/L. AUC can retrieved rxode2 model using usual R data.frame syntax. current dosage meet target AUC.","code":"#AUC 0_24 AUC_map_first_dose <- patB_map$model$AUC[which(patB_map$model$time == 24)] AUC_map_first_dose #> [1] 337.8965 #AUC 24_48 AUC_map_second_dose <- patB_map$model$AUC[which(patB_map$model$time == 48)] - AUC_map_first_dose AUC_map_second_dose #> [1] 325.3072"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"optimal-dose-selection-a-posteriori","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Optimal dose selection a posteriori","title":"AUC-based dose selection","text":"next dose needed achieve AUC24 400 mg.h/L can estimated using TDM data. optimal dose estimated next infusion 1411 mg.","code":"poso_dose_auc(dat=df_patientB, prior_model=mod_vancomycin_Goti2018, tdm=TRUE, time_auc=24, #AUC24 time_dose = 48, #48 h: immediately following the last observation duration=2, #infused over 2 h target_auc=400) #> $dose #> [1] 1411.593 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 400 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add.sd prop.sd ETA_Cl ETA_Vc #> 4 4.5 58.4 38.4 6.5 3.4 0.227 0.08208203 0.06122374 #> ETA_Vp CLCREAT DIAL WT #> 4 0.06285943 65 0 70"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"optimal-maintenance-dose-selection-a-posteriori","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Optimal maintenance dose selection a posteriori","title":"AUC-based dose selection","text":"maintenance dose needed reliably achieve AUC24 400 mg.h/L can estimated simulating multiple dose regimen enough administrations (e.g. 11 consecutive administrations, add_dose=10) approximate steady-state. optimal maintenance dose 1200 mg.","code":"poso_dose_auc(dat=df_patientB, prior_model=mod_vancomycin_Goti2018, time_auc=24, starting_time=24*9, interdose_interval=24, add_dose=10, duration=2, target_auc=400) #> $dose #> [1] 1198.266 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 400 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add.sd prop.sd ETA_Cl ETA_Vc #> 1 4.5 58.4 38.4 6.5 3.4 0.227 0.08208199 0.06122337 #> ETA_Vp CLCREAT DIAL WT #> 1 0.0628591 65 0 70"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"continuous-intravenous-infusion","dir":"Articles","previous_headings":"","what":"Continuous intravenous infusion","title":"AUC-based dose selection","text":"maintenance dose continuous intravenous infusion can easily determined setting duration infusion equal interdose_interval. optimal maintenance dose also 1200 mg / 24 h continuous intravenous infusion.","code":"poso_dose_auc(dat=df_patientB, prior_model=mod_vancomycin_Goti2018, time_auc=24, starting_time=24*9, interdose_interval=24, add_dose=10, duration=24, target_auc=400) #> $dose #> [1] 1198.923 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 400 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add.sd prop.sd ETA_Cl ETA_Vc #> 1 4.5 58.4 38.4 6.5 3.4 0.227 0.08208202 0.06122453 #> ETA_Vp CLCREAT DIAL WT #> 1 0.06285936 65 0 70"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Classic posologyr models","text":"Originally, posologyr models R lists; posologyr still uses format internally, ’s often useful use rxode2 syntax, even import NONMEM model using nonmem2rx package. article describes structure classical posologyr models. illustrates define published population models.","code":""},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"structure","dir":"Articles","previous_headings":"","what":"Structure","title":"Classic posologyr models","text":"posologyr model named R list following items: ppk_model rxode2 model implementing structural population model individual model (.e. model inter-individual variability) covariates error_model function residual error model, alternatively named list functions multiple endpoints model vignette(\"multiple_endpoints\") theta named vector population estimates fixed effects parameters (called THETAs, following NONMEM terminology) omega named square variance-covariance matrix population parameters inter-individual variability sigma estimates parameters residual error model pi_matrix Optional. named square variance-covariance matrix population parameters inter-occasion variability covariates character vector covariates model","code":""},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"definition-of-a-prior-model-through-an-example","dir":"Articles","previous_headings":"","what":"Definition of a prior model through an example","title":"Classic posologyr models","text":"model example two-compartment ppk model vancomycin derived retrospective study cohort 1,800 patients (doi:10.1097/FTD.0000000000000490).","code":""},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"ppk_model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"ppk_model","title":"Classic posologyr models","text":"model defined rxode2 mini-language. posologyr needs structural model, defined either differential algebraic equations, individual model. Depending model type, naming conventions less strict: Single endpoint model (e.g. pharmacokinetic models) concentration central compartment must named Cc. Multiple endpoints model (eg. PK-PD, parent-metabolite, blood-urine…) names endpoints flexible, must consistent names error models parameters. differential function d/dt(AUC) = Cc; needed optimization function poso_dose_auc().","code":"ppk_model = rxode2::rxode({ centr(0) = 0; TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) = Cc; })"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"error_model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"error_model","title":"Classic posologyr models","text":"function residual error model, taking two arguments: simulated concentrations, vector sigma estimates parameters residual error model. multiple endpoints models, error_model must named list function endpoint vignette(\"multiple_endpoints\"). obtain individual estimations multiple endpoints, consistency naming convention must maintained across following: dataset (using column DVID). residual error models (stored named list). standard deviation residual error models (stored named list, see sigma). many residual error models desired can defined. model defined named list error_models must counterpart named list sigma, names must match defined DVID column dataset.","code":"error_model <- function(f,sigma){ #additive model if sigma[2] == 0 g <- sigma[1]^2 + (sigma[2]^2)*(f^2) #proportional model if sigma[1] == 0 return(sqrt(g)) } error_model = list( first_endpoint = function(f,sigma){ g <- sigma[1]^2 + (sigma[2]^2)*(f^2) return(sqrt(g)) }, second_endpoint = function(f,sigma){ g <- sigma[1]^2 + (sigma[2]^2)*(f^2) return(sqrt(g)) } )"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"theta","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"theta","title":"Classic posologyr models","text":"estimations parameters fixed effects model (THETA), named vector. names must match names used ppk_model.","code":"theta = c(THETA_Cl=4.5, THETA_Vc=58.4, THETA_Vp=38.4, THETA_Q=6.5)"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"omega","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"omega","title":"Classic posologyr models","text":"variance-covariance matrix random effects (ETA) individual model. symmetric matrix. names must match names used ppk_model. easy way define using lotri::lotri(). estimates variances random effects can given different parameterizations depending authors. Standard deviation (SD): square root variance, returned Monolix Coefficient variation (CV): calculated sqrt(exp(SD^2)-1), variance can computed back log((CV^2)+1) Full covariance matrix: easiest reuse, less common literature case vancomycin model, estimates subject variability (BSV) given CV%. must converted variances prior inclusion omega. estimates covariance (-diagonal) sometimes given coefficients correlation ETAs. covariance ETA_a ETA_b can computed following product: standard_deviation(ETA_a) * standard_deviation(ETA_b) * correlation(ETA_a ETA_b). example, covariances equal zero.","code":"omega = lotri::lotri({ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.147, 0 , 0.510 , 0 , 0 , 0.282, 0 , 0 , 0 , 0)})"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"sigma","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"sigma","title":"Classic posologyr models","text":"estimates parameters residual error model standard deviation scale, either vector: matrix: named list (multiple endpoints): depending residual error model.","code":"sigma = c(additive_a = 3.4, proportional_b = 0.227) sigma = lotri::lotri({prop + add ~ c(0.227,0.0,3.4)}) sigma = list( first_endpoint=c(additive_a = 0.144, proportional_b = 0.15), second_endpoint=c(additive_a = 3.91, proportional_b = 0.0) )"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"pi_matrix","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"pi_matrix","title":"Classic posologyr models","text":"Optional: needed models inter-occasion variability (IOV). variance-covariance matrix random effects (KAPPA) IOV. omega matrix, names must match names used ppk_model. easy way define using lotri::lotri().","code":"pi_matrix = lotri::lotri({KAPPA_Cl + KAPPA_Vc ~ c(0.1934626, 0.00 , 0.05783106)})"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"covariates","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"covariates","title":"Classic posologyr models","text":"names every covariate defined ppk_model, character vector.","code":"covariates = c(\"CLCREAT\",\"WT\",\"DIAL\")"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"full-model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"Full model","title":"Classic posologyr models","text":"posologyr model list objects. Note: model include inter-occasion variability, pi_matrix omitted.","code":"mod_vancomyin_Goti2018 <- list( ppk_model = rxode2::rxode({ centr(0) = 0; TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) = Cc; }), error_model = function(f,sigma){ g <- sigma[1] + sigma[2]*f return(g) }, theta = c(THETA_Cl=4.5, THETA_Vc=58.4, THETA_Vp=38.4,THETA_Q=6.5), omega = lotri::lotri({ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.147, 0 , 0.510 , 0 , 0 , 0.282, 0 , 0 , 0 , 0)}), sigma = c(additive_a = 3.4, proportional_b = 0.227), covariates = c(\"CLCREAT\",\"WT\",\"DIAL\"))"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"resulting-r-object","dir":"Articles","previous_headings":"Definition of a prior model through an example > Full model","what":"Resulting R object","title":"Classic posologyr models","text":"","code":"mod_vancomyin_Goti2018 #> $ppk_model #> rxode2 NA model named rx_bce7176cfa18100af62e71ae38d3cd48 model (✔ ready). #> $state: centr, periph, AUC #> $params: THETA_Cl, CLCREAT, DIAL, THETA_Vc, WT, THETA_Vp, THETA_Q, ETA_Cl, ETA_Vc, ETA_Vp #> $lhs: TVCl, TVVc, TVVp, TVQ, Cl, Vc, Vp, Q, ke, k12, k21, Cc #> #> $error_model #> function(f,sigma){ #> g <- sigma[1] + sigma[2]*f #> return(g) #> } #> #> $theta #> THETA_Cl THETA_Vc THETA_Vp THETA_Q #> 4.5 58.4 38.4 6.5 #> #> $omega #> ETA_Cl ETA_Vc ETA_Vp ETA_Q #> ETA_Cl 0.147 0.00 0.000 0 #> ETA_Vc 0.000 0.51 0.000 0 #> ETA_Vp 0.000 0.00 0.282 0 #> ETA_Q 0.000 0.00 0.000 0 #> #> $sigma #> additive_a proportional_b #> 3.400 0.227 #> #> $covariates #> [1] \"CLCREAT\" \"WT\" \"DIAL\""},{"path":"https://levenc.github.io/posologyr/articles/multiple_endpoints.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Multiple endpoints","text":"different error model can defined multiple endpoints models (eg. PK-PD, parent-metabolite, blood-urine…). example can seen , utilizing warfarin data model (provided Tomoo Funaki Nick Holford) nlmixr documentation (https://nlmixr2.org/articles/multiple-endpoints.html).","code":""},{"path":"https://levenc.github.io/posologyr/articles/multiple_endpoints.html","id":"warfarin-pkpd-model","dir":"Articles","previous_headings":"Introduction","what":"warfarin PKPD model","title":"Multiple endpoints","text":"","code":"mod_warfarin_nlmixr <- function() { ini({ #Fixed effects: population estimates THETA_ktr=0.106 THETA_ka=-0.087 THETA_cl=-2.03 THETA_v=2.07 THETA_emax=3.4 THETA_ec50=0.00724 THETA_kout=-2.9 THETA_e0=4.57 #Random effects: inter-individual variability ETA_ktr ~ 1.024695 ETA_ka ~ 0.9518403 ETA_cl ~ 0.5300943 ETA_v ~ 0.4785394 ETA_emax ~ 0.7134424 ETA_ec50 ~ 0.7204165 ETA_kout ~ 0.3563706 ETA_e0 ~ 0.2660827 #Unexplained residual variability cp.sd <- 0.144 cp.prop.sd <- 0.15 pca.sd <- 3.91 }) model({ #Individual model and covariates ktr <- exp(THETA_ktr + ETA_ktr) ka <- exp(THETA_ka + ETA_ka) cl <- exp(THETA_cl + ETA_cl) v <- exp(THETA_v + ETA_v) emax = expit(THETA_emax + ETA_emax) ec50 = exp(THETA_ec50 + ETA_ec50) kout = exp(THETA_kout + ETA_kout) e0 = exp(THETA_e0 + ETA_e0) #Structural model defined using ordinary differential equations (ODE) DCP = center/v PD=1-emax*DCP/(ec50+DCP) effect(0) = e0 kin = e0*kout d/dt(depot) = -ktr * depot d/dt(gut) = ktr * depot -ka * gut d/dt(center) = ka * gut - cl / v * center d/dt(effect) = kin*PD -kout*effect cp = center / v pca = effect #Model for unexplained residual variability cp ~ add(cp.sd) + prop(cp.prop.sd) pca ~ add(pca.sd) }) }"},{"path":"https://levenc.github.io/posologyr/articles/multiple_endpoints.html","id":"data-first-subject-from-the-warfarin-dataset","dir":"Articles","previous_headings":"Introduction","what":"data: first subject from the warfarin dataset","title":"Multiple endpoints","text":"posologyr can compute EBE combined PKPD model poso_estim_map() observation/time curves endpoints can also plotted","code":"warf_01 <- data.frame(ID=1, TIME=c(0.0,1.0,3.0,6.0,24.0,24.0,36.0,36.0,48.0,48.0,72.0,72.0,144.0), DV=c(0.0,1.9,6.6,10.8,5.6,44.0,4.0,27.0,2.7,28.0,0.8,31.0,71.0), DVID=c(\"cp\",\"cp\",\"cp\",\"cp\",\"cp\",\"pca\",\"cp\",\"pca\",\"cp\",\"pca\",\"cp\",\"pca\",\"pca\"), EVID=c(1,0,0,0,0,0,0,0,0,0,0,0,0), AMT=c(100,0,0,0,0,0,0,0,0,0,0,0,0)) warf_01 #> ID TIME DV DVID EVID AMT #> 1 1 0 0.0 cp 1 100 #> 2 1 1 1.9 cp 0 0 #> 3 1 3 6.6 cp 0 0 #> 4 1 6 10.8 cp 0 0 #> 5 1 24 5.6 cp 0 0 #> 6 1 24 44.0 pca 0 0 #> 7 1 36 4.0 cp 0 0 #> 8 1 36 27.0 pca 0 0 #> 9 1 48 2.7 cp 0 0 #> 10 1 48 28.0 pca 0 0 #> 11 1 72 0.8 cp 0 0 #> 12 1 72 31.0 pca 0 0 #> 13 1 144 71.0 pca 0 0 map_warf_01 <- poso_estim_map(warf_01,mod_warfarin_nlmixr) map_warf_01 #> $eta #> ETA_ktr ETA_ka ETA_cl ETA_v ETA_emax ETA_ec50 #> -0.32052193 -0.54227235 0.79432182 -0.02986447 0.02383273 -0.28133882 #> ETA_kout ETA_e0 #> -0.30872226 -0.08386652 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> THETA_ktr THETA_ka THETA_cl THETA_v THETA_emax THETA_ec50 #> 0.10600000 -0.08700000 -2.03000000 2.07000000 3.40000000 0.00724000 #> THETA_kout THETA_e0 cp.sd cp.prop.sd pca.sd ETA_ktr #> -2.90000000 4.57000000 0.14400000 0.15000000 3.91000000 -0.32052193 #> ETA_ka ETA_cl ETA_v ETA_emax ETA_ec50 ETA_kout #> -0.54227235 0.79432182 -0.02986447 0.02383273 -0.28133882 -0.30872226 #> ETA_e0 #> -0.08386652 #> ── Initial Conditions ($inits): ── #> depot gut center effect #> 0 0 0 0 #> ── First part of data (object): ── #> # A tibble: 1,451 × 18 #> time ktr ka cl v emax ec50 kout e0 DCP PD kin #> #> 1 0 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0 1 3.59 #> 2 0.1 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.0267 0.967 3.59 #> 3 0.2 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.102 0.885 3.59 #> 4 0.3 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.219 0.783 3.59 #> 5 0.4 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.373 0.681 3.59 #> 6 0.5 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.557 0.590 3.59 #> # ℹ 1,445 more rows #> # ℹ 6 more variables: cp , pca , depot , gut , #> # center , effect #> #> $event #> id time amt evid #> #> 1: 1 0.0 NA 0 #> 2: 1 0.0 100 1 #> 3: 1 0.1 NA 0 #> 4: 1 0.2 NA 0 #> 5: 1 0.3 NA 0 #> --- #> 1448: 1 144.6 NA 0 #> 1449: 1 144.7 NA 0 #> 1450: 1 144.8 NA 0 #> 1451: 1 144.9 NA 0 #> 1452: 1 145.0 NA 0 plot(map_warf_01$model,\"cp\") plot(map_warf_01$model,\"pca\")"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Patient data","text":"describes structure patient records compatible posologyr.","code":""},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"structure","dir":"Articles","previous_headings":"","what":"Structure","title":"Patient data","text":"Data input posologyr type data input rxode2. stated rxode2 documentation (rxode2 datasets), also similar data NONMEM. patient dataset table sequential event records, line event. description different event types available rxode2 documentation (rxode2 Event Types). minimal working example:","code":"data.frame(ID=1, TIME=c(0.0,3), DV=c(NA,60.0), AMT=c(1000,0), EVID=c(101,0)) #> ID TIME DV AMT EVID #> 1 1 0 NA 1000 101 #> 2 1 3 60 0 0"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"required-fields-and-data","dir":"Articles","previous_headings":"Structure","what":"Required fields and data","title":"Patient data","text":"TIME Dosing times, sampling times therapeutic drug monitoring (TDM). units depend specification population pharmacokinetics (ppk) model. AMT Amount drug administered. units depend specification ppk model. EVID Event type. Must 0 observations (concentrations TDM). DV concentrations. Must NA EVID 0. Covariates Every covariate defined prior posologyr model. column names must match covariate vector ppk model. OCC Occasions. Required models inter-occasion variability. DVID Observation type. Required models multiple endpoints. CMT Name (number) compartment dose administered, see vignette(\"route_of_administration\").","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"a-priori-dose-adjustment","dir":"Articles","previous_headings":"Common use cases","what":"A priori dose adjustment","title":"Patient data","text":"dosing: simplest patient record single line dataframe, individual patient covariates, columns (TIME, DV, AMT, EVID) set zero.","code":"data.frame(ID=1, TIME=0, DV=0, AMT=0, EVID=0, COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID COVAR1 COVAR2 #> 1 1 0 0 0 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"oral-administration-or-iv-bolus","dir":"Articles","previous_headings":"Common use cases","what":"Oral administration or IV bolus","title":"Patient data","text":"EVID = 1 instantaneous administration first compartment defined ppk model: either central compartment IV bolus, depot compartment oral administration.","code":"data.frame(ID=1, TIME=c(0.0,3), DV=c(NA,60.0), AMT=c(1000,0), EVID=c(1,0), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID COVAR1 COVAR2 #> 1 1 0 NA 1000 1 X Y #> 2 1 3 60 0 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"intermittent-infusion","dir":"Articles","previous_headings":"Common use cases","what":"Intermittent infusion","title":"Patient data","text":"EVID = 1 bolus infusion, administered first compartment defined ppk model. DUR defines duration. AMT amount administered duration DUR.","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(1000,0,0), DUR=c(0.5,NA,NA), EVID=c(1,0,0), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT DUR EVID COVAR1 COVAR2 #> 1 1 0 NA 1000 0.5 1 X Y #> 2 1 1 25.0 0 NA 0 X Y #> 3 1 14 5.5 0 NA 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"inter-occasion-variability","dir":"Articles","previous_headings":"Common use cases","what":"Inter-occasion variability","title":"Patient data","text":"given occasion, value OCC must repeated row. OCC must specified rows table.","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0,24.0,25.0,36.0), DV=c(NA,25.0,5.5,NA,30.0,6.0), AMT=c(1000,0,0,1000,0,0), DUR=c(0.5,NA,NA,0.5,NA,NA), EVID=c(1,0,0,1,0,0), OCC=c(1,1,1,2,2,2), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT DUR EVID OCC COVAR1 COVAR2 #> 1 1 0 NA 1000 0.5 1 1 X Y #> 2 1 1 25.0 0 NA 0 1 X Y #> 3 1 14 5.5 0 NA 0 1 X Y #> 4 1 24 NA 1000 0.5 1 2 X Y #> 5 1 25 30.0 0 NA 0 2 X Y #> 6 1 36 6.0 0 NA 0 2 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"multiple-endpoints","dir":"Articles","previous_headings":"Common use cases","what":"Multiple endpoints","title":"Patient data","text":"DVID used specify type observation. values DVID dataset must match names residual error models, see vignette(\"multiple_endpoints\").","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0,24.0,25.0,36.0), DV=c(NA,20.0,80,35.5,60.0,40.0), AMT=c(1000,0,0,0,0,0), EVID=c(1,0,0,0,0,0), DVID=c(\"parent\",\"parent\",\"metabolite\",\"parent\",\"metabolite\",\"metabolite\"), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID DVID COVAR1 COVAR2 #> 1 1 0 NA 1000 1 parent X Y #> 2 1 1 20.0 0 0 parent X Y #> 3 1 14 80.0 0 0 metabolite X Y #> 4 1 24 35.5 0 0 parent X Y #> 5 1 25 60.0 0 0 metabolite X Y #> 6 1 36 40.0 0 0 metabolite X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Patient records","text":"describes structure patient records usable posologyr.","code":""},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"structure","dir":"Articles","previous_headings":"","what":"Structure","title":"Patient records","text":"Data input posologyr type data input rxode2. stated rxode2 documentation (rxode2 datasets), also similar data NONMEM. patient dataset table sequential event records, line event. description different event types available rxode2 documentation (rxode2 Event Types). minimal working example:","code":"data.frame(ID=1, TIME=c(0.0,3), DV=c(NA,60.0), AMT=c(1000,0), EVID=c(101,0)) #> ID TIME DV AMT EVID #> 1 1 0 NA 1000 101 #> 2 1 3 60 0 0"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"required-fields-and-data","dir":"Articles","previous_headings":"Structure","what":"Required fields and data","title":"Patient records","text":"TIME Dosing times, sampling times therapeutic drug monitoring (TDM). units depend specification population pharmacokinetics (ppk) model. AMT Amount drug administered. units depend specification ppk model. EVID Event type. Must 0 observations (concentrations TDM). DV concentrations. Must NA EVID 0. Covariates Every covariate defined prior posologyr model. column names must match covariate vector ppk model. OCC Occasions. Required models inter-occasion variability. DVID Observation type. Required models multiple endpoints. CMT Name (number) compartment dose administered, see vignette(\"route_of_administration\").","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"a-priori-dose-adjustment","dir":"Articles","previous_headings":"Common use cases","what":"A priori dose adjustment","title":"Patient records","text":"dosing: simplest patient record single line dataframe, individual patient covariates, columns (TIME, DV, AMT, EVID) set zero.","code":"data.frame(ID=1, TIME=0, DV=0, AMT=0, EVID=0, COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID COVAR1 COVAR2 #> 1 1 0 0 0 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"oral-administration-or-iv-bolus","dir":"Articles","previous_headings":"Common use cases","what":"Oral administration or IV bolus","title":"Patient records","text":"EVID = 1 instantaneous administration first compartment defined ppk model: either central compartment IV bolus, depot compartment oral administration.","code":"data.frame(ID=1, TIME=c(0.0,3), DV=c(NA,60.0), AMT=c(1000,0), EVID=c(1,0), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID COVAR1 COVAR2 #> 1 1 0 NA 1000 1 X Y #> 2 1 3 60 0 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"intermittent-infusion","dir":"Articles","previous_headings":"Common use cases","what":"Intermittent infusion","title":"Patient records","text":"EVID = 1 bolus infusion, administered first compartment defined ppk model. DUR defines duration. AMT amount administered duration DUR.","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(1000,0,0), DUR=c(0.5,NA,NA), EVID=c(1,0,0), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT DUR EVID COVAR1 COVAR2 #> 1 1 0 NA 1000 0.5 1 X Y #> 2 1 1 25.0 0 NA 0 X Y #> 3 1 14 5.5 0 NA 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"inter-occasion-variability","dir":"Articles","previous_headings":"Common use cases","what":"Inter-occasion variability","title":"Patient records","text":"given occasion, value OCC must repeated row. OCC must specified rows table.","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0,24.0,25.0,36.0), DV=c(NA,25.0,5.5,NA,30.0,6.0), AMT=c(1000,0,0,1000,0,0), DUR=c(0.5,NA,NA,0.5,NA,NA), EVID=c(1,0,0,1,0,0), OCC=c(1,1,1,2,2,2), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT DUR EVID OCC COVAR1 COVAR2 #> 1 1 0 NA 1000 0.5 1 1 X Y #> 2 1 1 25.0 0 NA 0 1 X Y #> 3 1 14 5.5 0 NA 0 1 X Y #> 4 1 24 NA 1000 0.5 1 2 X Y #> 5 1 25 30.0 0 NA 0 2 X Y #> 6 1 36 6.0 0 NA 0 2 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"multiple-endpoints","dir":"Articles","previous_headings":"Common use cases","what":"Multiple endpoints","title":"Patient records","text":"DVID used specify type observation. values DVID dataset must match names residual error models, see vignette(\"multiple_endpoints\").","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0,24.0,25.0,36.0), DV=c(NA,20.0,80,35.5,60.0,40.0), AMT=c(1000,0,0,0,0,0), EVID=c(1,0,0,0,0,0), DVID=c(\"parent\",\"parent\",\"metabolite\",\"parent\",\"metabolite\",\"metabolite\"), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID DVID COVAR1 COVAR2 #> 1 1 0 NA 1000 1 parent X Y #> 2 1 1 20.0 0 0 parent X Y #> 3 1 14 80.0 0 0 metabolite X Y #> 4 1 24 35.5 0 0 parent X Y #> 5 1 25 60.0 0 0 metabolite X Y #> 6 1 36 40.0 0 0 metabolite X Y"},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Population models","text":"describes structure prior population models compatible posologyr illustrates define new models published population models.","code":""},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"general-structure","dir":"Articles","previous_headings":"","what":"General structure","title":"Population models","text":"models can written model function can parsed rxode2. models written two block statements: ini({}) defining parameter values model({}) ODE-based model specification. example, gentamicin model Xuan et al. 2003 (doi:10.1016/j.ijantimicag.2003.07.010) can written : rxode2 mini-language syntax detailed rxode2 documentation.","code":"mod_gentamicin_Xuan2003 <- function() { ini({ #Fixed effects: population estimates THETA_Cl = 0.047 THETA_V = 0.28 THETA_k12 = 0.092 THETA_k21 = 0.071 #Random effects: inter-individual variability ETA_Cl ~ 0.084 ETA_V ~ 0.003 ETA_k12 ~ 0.398 ETA_k21 ~ 0.342 #Unexplained residual variability add_sd <- 0.230 prop_sd <- 0.237 }) model({ #Individual model and covariates TVl = THETA_Cl*ClCr TVV = THETA_V*WT TVk12 = THETA_k12 TVk21 = THETA_k21 Cl = TVl*exp(ETA_Cl) V = TVV*exp(ETA_V) k12 = TVk12*exp(ETA_k12) k21 = TVk21*exp(ETA_k21) #Structural model defined using ordinary differential equations (ODE) ke = Cl/V Cp = centr/V d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph #Model for unexplained residual variability Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) }"},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"individual-model-random-effects","dir":"Articles","previous_headings":"","what":"Individual model, random effects","title":"Population models","text":"Inter-individual variability can also defined symmetric matrix integrate covariance random effects. example, amikacin model Burdet et al. 2015 (doi:10.1007/s00228-014-1766-y) can written : estimates variances random effects can given different parameterizations depending authors. Standard deviation (SD): square root variance, returned Monolix Coefficient variation (CV): calculated sqrt(exp(SD^2)-1), variance can computed back log((CV^2)+1) Full covariance matrix: easiest reuse, less common literature estimates covariance (diagonal) sometimes given coefficients correlation ETAs. covariance ETA_a ETA_b can computed following product: standard_deviation(ETA_a) * standard_deviation(ETA_b) * correlation(ETA_a ETA_b).","code":"mod_amikacin_Burdet2015 <- function() { ini({ #Fixed effects: population estimates THETA_Cl=4.3 THETA_Vc=15.9 THETA_Vp=21.4 THETA_Q=12.1 #Random effects: inter-individual variability ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.1, 0.01 , 0.05 , 0.01 , 0.02 , 0.2 , -0.06 , 0.004, 0.003, 0.08) #Unexplained residual variability add_sd <- 0.2 prop_sd <- 0.1 }) model({ #Individual model and covariates TVCl = THETA_Cl*(CLCREAT4H/82)^0.7 TVVc = THETA_Vc*(TBW/78)^0.9*(PoverF/169)^0.4 TVVp = THETA_Vp TVQ = THETA_Q Cl = TVCl*exp(ETA_Cl) Vc = TVVc*exp(ETA_Vc) Vp = TVVp*exp(ETA_Vp) Q = TVQ *exp(ETA_Q) #Structural model defined using ordinary differential equations (ODE) ke = Cl/Vc k12 = Q/Vc k21 = Q/Vp Cp = centr/Vc d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph #Model for unexplained residual variability Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) }"},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"bioavailability-lag-time","dir":"Articles","previous_headings":"","what":"Bioavailability, lag-time","title":"Population models","text":"Special model event changes including bioavailability (f(depot)=1), lag time (alag(depot)=0) can used model({}) block. example, ganciclovir model Caldès et al. 2009 (doi:10.1128/aac.00085-09) can written :","code":"mod_ganciclovir_Caldes2009 <- function() { ini({ #Fixed effects: population estimates THETA_cl <- 7.49 THETA_v1 <- 31.90 THETA_cld <- 10.20 THETA_v2 <- 32.0 THETA_ka <- 0.895 THETA_baf <- 0.825 #Random effects: inter-individual variability ETA_cl ~ 0.107 ETA_v1 ~ 0.227 ETA_ka ~ 0.464 ETA_baf ~ 0.049 #Unexplained residual variability add.sd <- 0.465 prop.sd <- 0.143 }) model({ #Individual model and covariates TVcl = THETA_cl*(ClCr/57); TVv1 = THETA_v1; TVcld = THETA_cld; TVv2 = THETA_v2; TVka = THETA_ka; TVbaf = THETA_baf; cl = TVcl*exp(ETA_cl); v1 = TVv1*exp(ETA_v1); cld = TVcld; v2 = TVv2; ka = TVka*exp(ETA_ka); baf = TVbaf*exp(ETA_baf); #Structural model defined using ordinary differential equations (ODE) k10 = cl/v1; k12 = cld / v1; k21 = cld / v2; Cc = centr/v1; d/dt(depot) = -ka*depot d/dt(centr) = ka*depot - k10*centr - k12*centr + k21*periph; d/dt(periph) = k12*centr - k21*periph; d/dt(AUC) = Cc; #Special model event changes f(depot)=baf; alag(depot)=0.382; #Model for unexplained residual variability Cc ~ add(add.sd) + prop(prop.sd) + combined1() }) }"},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"classic-posologyr-models","dir":"Articles","previous_headings":"","what":"Classic posologyr models","title":"Population models","text":"models described rxode2 model function alone. possible define classic posologyr model, see vignette (\"classic_posologyr_models\"). Models falling category : models inter-occasion variability (IOV), sometimes called intra-individual variability models unexplained residual error model additive, proportional, combined models","code":""},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"User defined models","text":"describes structure prior models usable posologyr illustrates define new models published population pharmacokinetic (ppk) models.","code":""},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"structure","dir":"Articles","previous_headings":"","what":"Structure","title":"User defined models","text":"posologyr prior ppk model named R list: ppk_model rxode2 model implementing structural population pharmacokinetics model individual model (.e. model inter-individual variability) covariates error_model function residual error model, alternatively named list functions multiple endpoints model vignette(\"multiple_endpoints\") theta named vector population estimates fixed effects parameters (called THETAs, following NONMEM terminology) omega named square variance-covariance matrix population parameters inter-individual variability sigma estimates parameters residual error model pi_matrix Optional. named square variance-covariance matrix population parameters inter-occasion variability covariates character vector covariates model","code":""},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"definition-of-a-prior-model-through-an-example","dir":"Articles","previous_headings":"","what":"Definition of a prior model through an example","title":"User defined models","text":"model implement two-compartment ppk model vancomycin derived retrospective study cohort 1,800 patients (doi:10.1097/FTD.0000000000000490).","code":""},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"ppk_model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"ppk_model","title":"User defined models","text":"model defined rxode2::rxode() mini-language. posologyr needs structural model, defined either differential algebraic equations, individual model. concentration central compartment must named Cc. differential function d/dt(AUC) = Cc; needed optimisation function poso_dose_auc().","code":"ppk_model = rxode2::rxode({ centr(0) = 0; TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) = Cc; })"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"error_model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"error_model","title":"User defined models","text":"function residual error model, taking two arguments: simulated concentrations, vector sigma estimates parameters residual error model. Alternatively, function can take simulated concentrations, matrix sigma estimates parameters residual error model, following example: multiple endpoint models, error_model must named list function endpoint vignette(\"multiple_endpoints\").","code":"error_model <- function(f,sigma){ #additive model if sigma[2] == 0 g <- sigma[1] + sigma[2]*f #proportional model if sigma[1] == 0 return(g) } error_model <- function(f,sigma){ dv <- cbind(f,1) g <- diag(dv%*%sigma%*%t(dv)) #sigma is the square matrix of the residual return(sqrt(g)) #errors }"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"theta","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"theta","title":"User defined models","text":"estimations parameters fixed effects model (THETA), named vector. names must match names used ppk_model.","code":"theta = c(THETA_Cl=4.5, THETA_Vc=58.4, THETA_Vp=38.4, THETA_Q=6.5)"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"omega","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"omega","title":"User defined models","text":"variance-covariance matrix random effects (ETA) individual model. symmetric matrix. names must match names used ppk_model. easy way define using lotri::lotri(). estimates variances random effects can given different parameterizations depending authors. Standard deviation (SD): square root variance, returned Monolix Coefficient variation (CV): calculated sqrt(exp(SD^2)-1), standard deviation can computed back sqrt(log((CV^2)+1)) Full covariance matrix: easiest reuse, rarely seen articles case vancomycin model, estimates subject variability (BSV) given CV%. must converted variances prior inclusion omega. estimates covariance (diagonal) sometimes given coefficients correlation ETAs. covariance ETA_a ETA_b can computed following product: standard_deviation(ETA_a) * standard_deviation(ETA_b) * correlation(ETA_a ETA_b). example, covariances equal zero.","code":"omega = lotri::lotri({ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.147, 0 , 0.510 , 0 , 0 , 0.282, 0 , 0 , 0 , 0)})"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"sigma","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"sigma","title":"User defined models","text":"estimates parameters residual error model, either vector: matrix: named list, see vignette(\"multiple_endpoints\"): depending residual error model.","code":"sigma = c(additive_a = 3.4, proportional_b = 0.227) sigma = lotri::lotri({prop + add ~ c(0.227,0.0,3.4)}) sigma = list( cp=c(additive_a = 0.144, proportional_b = 0.15), pca=c(additive_a = 3.91, proportional_b = 0.0) )"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"pi_matrix","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"pi_matrix","title":"User defined models","text":"Optional: needed models inter-occasion variability (IOV). variance-covariance matrix random effects (KAPPA) IOV. omega matrix, names must match names used ppk_model. easy way define using lotri::lotri().","code":"pi_matrix = lotri::lotri({KAPPA_Cl + KAPPA_Vc ~ c(0.1934626, 0.00 , 0.05783106)})"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"covariates","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"covariates","title":"User defined models","text":"names every covariate defined ppk_model, character vector.","code":"covariates = c(\"CLCREAT\",\"WT\",\"DIAL\")"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"full-model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"Full model","title":"User defined models","text":"posologyr model list objects. Note: model include inter-occasion variability, pi_matrix omitted.","code":"mod_vancomyin_Goti2018 <- list( ppk_model = rxode2::rxode({ centr(0) = 0; TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) = Cc; }), error_model = function(f,sigma){ g <- sigma[1] + sigma[2]*f return(g) }, theta = c(THETA_Cl=4.5, THETA_Vc=58.4, THETA_Vp=38.4,THETA_Q=6.5), omega = lotri::lotri({ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.147, 0 , 0.510 , 0 , 0 , 0.282, 0 , 0 , 0 , 0)}), sigma = c(additive_a = 3.4, proportional_b = 0.227), covariates = c(\"CLCREAT\",\"WT\",\"DIAL\"))"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"resulting-r-object","dir":"Articles","previous_headings":"Definition of a prior model through an example > Full model","what":"Resulting R object","title":"User defined models","text":"","code":"mod_vancomyin_Goti2018 #> $ppk_model #> rxode2 NA model named rx_bce7176cfa18100af62e71ae38d3cd48 model (✔ ready). #> $state: centr, periph, AUC #> $params: THETA_Cl, CLCREAT, DIAL, THETA_Vc, WT, THETA_Vp, THETA_Q, ETA_Cl, ETA_Vc, ETA_Vp #> $lhs: TVCl, TVVc, TVVp, TVQ, Cl, Vc, Vp, Q, ke, k12, k21, Cc #> #> $error_model #> function(f,sigma){ #> g <- sigma[1] + sigma[2]*f #> return(g) #> } #> #> $theta #> THETA_Cl THETA_Vc THETA_Vp THETA_Q #> 4.5 58.4 38.4 6.5 #> #> $omega #> ETA_Cl ETA_Vc ETA_Vp ETA_Q #> ETA_Cl 0.147 0.00 0.000 0 #> ETA_Vc 0.000 0.51 0.000 0 #> ETA_Vp 0.000 0.00 0.282 0 #> ETA_Q 0.000 0.00 0.000 0 #> #> $sigma #> additive_a proportional_b #> 3.400 0.227 #> #> $covariates #> [1] \"CLCREAT\" \"WT\" \"DIAL\""},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Route of administration","text":"Caldès 2009 ganciclovir model (https://doi.org/10.1128/aac.00085-09) capable describing pharmacokinetics either injectable ganciclovir oral valganciclovir.","code":"mod_ganciclovir_Caldes_2009 <- function() { ini({ THETA_cl <- 7.49 THETA_v1 <- 31.90 THETA_cld <- 10.20 THETA_v2 <- 32.0 THETA_ka <- 0.895 THETA_baf <- 0.825 ETA_cl ~ 0.107 ETA_v1 ~ 0.227 ETA_ka ~ 0.464 ETA_baf ~ 0.049 add.sd <- 0.465 prop.sd <- 0.143 }) model({ TVcl = THETA_cl*(ClCr/57); TVv1 = THETA_v1; TVcld = THETA_cld; TVv2 = THETA_v2; TVka = THETA_ka; TVbaf = THETA_baf; cl = TVcl*exp(ETA_cl); v1 = TVv1*exp(ETA_v1); cld = TVcld; v2 = TVv2; ka = TVka*exp(ETA_ka); baf = TVbaf*exp(ETA_baf); k10 = cl/v1; k12 = cld / v1; k21 = cld / v2; Cc = centr/v1; d/dt(depot) = -ka*depot d/dt(centr) = ka*depot - k10*centr - k12*centr + k21*periph; d/dt(periph) = k12*centr - k21*periph; d/dt(AUC) = Cc; f(depot)=baf; alag(depot)=0.382; Cc ~ add(add.sd) + prop(prop.sd) + combined1() }) }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"patient-record-with-tdm-data","dir":"Articles","previous_headings":"Intravenous ganciclovir","what":"Patient record with TDM data","title":"Route of administration","text":"describe intravenous administration, CMT column added TDM data table indicate administrations directly central compartment. Note: compute AUC last dose time last dose + 24 hours, dummy dose 0 mg added time last observation interest (.e. H144).","code":"patient <- data.frame(ID=1,TIME=c(0,121,122,126,144), DV=c(NA,10.8,5.8,3.3,NA), ADDL=c(5,0,0,0,0), II=c(24,0,0,0,0), EVID=c(1,0,0,0,1), CMT=c(\"centr\",NA,NA,NA,\"centr\"), AMT=c(250,0,0,0,0), DUR=c(0.5,NA,NA,NA,NA), ClCr=25) patient #> ID TIME DV ADDL II EVID CMT AMT DUR ClCr #> 1 1 0 NA 5 24 1 centr 250 0.5 25 #> 2 1 121 10.8 0 0 0 0 NA 25 #> 3 1 122 5.8 0 0 0 0 NA 25 #> 4 1 126 3.3 0 0 0 0 NA 25 #> 5 1 144 NA 0 0 1 centr 0 NA 25"},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"individual-pk-profile-and-auc-0-24","dir":"Articles","previous_headings":"Intravenous ganciclovir","what":"Individual PK profile and AUC 0-24","title":"Route of administration","text":"individual PK profile can estimated, plotted. difference cumulative AUC H144 H120 gives AUC 0-24 last dose. Using data.table optional, syntax convenient.","code":"map_patient <- poso_estim_map(patient,mod_ganciclovir_Caldes_2009) plot(map_patient$model,Cc) library(data.table) data.table(map_patient$model)[time==144,AUC] - data.table(map_patient$model)[time==120,AUC] #> [1] 72.19085"},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"optimal-dose-for-an-intravenous-ganciclovir-injection","dir":"Articles","previous_headings":"Intravenous ganciclovir","what":"Optimal dose for an intravenous ganciclovir injection","title":"Route of administration","text":"optimal dose achieve AUC 50 mg.h/L can determined new injection IV ganciclovir setting cmt_dose = \"centr\".","code":"poso_dose_auc(patient,mod_ganciclovir_Caldes_2009,tdm=TRUE, time_dose = 145, duration = 1, time_auc = 24, target_auc = 50, cmt_dose = \"centr\") #> $dose #> [1] 156.5335 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 50 #> #> $indiv_param #> THETA_cl THETA_v1 THETA_cld THETA_v2 THETA_ka THETA_baf add.sd prop.sd #> 1 7.49 31.9 10.2 32 0.895 0.825 0.465 0.143 #> ETA_cl ETA_v1 ETA_ka ETA_baf covar #> 1 0.05256541 -0.4773341 -3.589527e-08 -1.272466e-07 25"},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"optimal-dose-for-an-oral-valganciclovir-administration","dir":"Articles","previous_headings":"Intravenous ganciclovir","what":"Optimal dose for an oral valganciclovir administration","title":"Route of administration","text":"optimal dose achieve AUC 50 mg.h/L can determined administration oral valganciclovir setting cmt_dose = \"depot\". Keeping default value cmt_dose, first compartment declared PK model, also work .","code":"poso_dose_auc(patient,mod_ganciclovir_Caldes_2009,tdm=TRUE, time_dose = 145, time_auc = 24, target_auc = 50, cmt_dose = \"depot\") #> $dose #> [1] 193.1298 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 50 #> #> $indiv_param #> THETA_cl THETA_v1 THETA_cld THETA_v2 THETA_ka THETA_baf add.sd prop.sd #> 1 7.49 31.9 10.2 32 0.895 0.825 0.465 0.143 #> ETA_cl ETA_v1 ETA_ka ETA_baf covar #> 1 0.0525648 -0.4773328 -1.018546e-06 2.327066e-07 25"},{"path":"https://levenc.github.io/posologyr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Cyril Leven. Author, maintainer, copyright holder. Matthew Fidler. Contributor. Emmanuelle Comets. Contributor. Audrey Lavenu. Contributor. Marc Lavielle. Contributor.","code":""},{"path":"https://levenc.github.io/posologyr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Leven C, Coste , Mané C (2022). “Free Open-Source Posologyr Software Bayesian Dose Individualization: Extensive Validation Simulated Data.” Pharmaceutics, 14(2), 442. doi:10.3390/pharmaceutics14020442, https://europepmc.org/article/pmc/8879752.","code":"@Article{posologyrpaper, title = {Free and Open-Source Posologyr Software for Bayesian Dose Individualization: An Extensive Validation on Simulated Data}, author = {Cyril Leven and Anne Coste and Camille Mané}, journal = {Pharmaceutics}, year = {2022}, volume = {14}, pages = {442}, number = {2}, doi = {10.3390/pharmaceutics14020442}, publisher = {MDPI}, url = {https://europepmc.org/article/pmc/8879752}, }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"Personalize drug regimens using individual pharmacokinetic (PK) pharmacokinetic-pharmacodynamic (PK-PD) profiles. combining therapeutic drug monitoring (TDM) data population model, posologyr offers accurate posterior estimates helps compute optimal individualized dosing regimens. Key dosage optimization functions posologyr include: poso_dose_conc() estimates optimal dose achieve target concentration given time poso_dose_auc() estimates dose needed reach target area concentration-time curve (AUC) poso_time_cmin() estimates time required reach target trough concentration (Cmin) poso_inter_cmin() estimates optimal dosing interval consistently achieve target Cmin Individual PK profiles can estimated without TDM data: poso_estim_map() computes Maximum Posteriori Bayesian Estimates (MAP-) individual PK parameters using TDM results poso_simu_pop() samples prior distributions PK parameters posologyr leverages simulation capabilities rxode2 package.","code":""},{"path":"https://levenc.github.io/posologyr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"can install released version posologyr CRAN : can install development version posologyr GitHub :","code":"install.packages(\"posologyr\") # install.packages(\"remotes\") remotes::install_github(\"levenc/posologyr\")"},{"path":"https://levenc.github.io/posologyr/index.html","id":"bayesian-dosing-example","dir":"","previous_headings":"","what":"Bayesian dosing example","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"determine optimal dose gentamicin patient posologyr, need: prior PK model, written rxode2 mini-language example, gentamicin PK literature doi:10.1016/j.ijantimicag.2003.07.010 table patient’s TDM data, format similar data NONMEM","code":"mod_gentamicin_Xuan2003 <- function() { ini({ THETA_Cl = 0.047 THETA_V = 0.28 THETA_k12 = 0.092 THETA_k21 = 0.071 ETA_Cl ~ 0.084 ETA_V ~ 0.003 ETA_k12 ~ 0.398 ETA_k21 ~ 0.342 add_sd <- 0.230 prop_sd <- 0.237 }) model({ TVl = THETA_Cl*ClCr TVV = THETA_V*WT TVk12 = THETA_k12 TVk21 = THETA_k21 Cl = TVl*exp(ETA_Cl) V = TVV*exp(ETA_V) k12 = TVk12*exp(ETA_k12) k21 = TVk21 *exp(ETA_k21) ke = Cl/V Cp = centr/V d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) } patient_data <- data.frame(ID=1, TIME=c(0.0,1.0,11.0), DV=c(NA,9,2), AMT=c(180,0,0), DUR=c(0.5,NA,NA), EVID=c(1,0,0), ClCr=38, WT=63) patient_data #> ID TIME DV AMT DUR EVID ClCr WT #> 1 1 0 NA 180 0.5 1 38 63 #> 2 1 1 9 0 NA 0 38 63 #> 3 1 11 2 0 NA 0 38 63"},{"path":"https://levenc.github.io/posologyr/index.html","id":"individual-pk-profile","dir":"","previous_headings":"Bayesian dosing example","what":"Individual PK profile","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"two elements, can estimate plot individual concentrations time.","code":"library(\"posologyr\") patient_map <- poso_estim_map(patient_data,mod_gentamicin_Xuan2003) plot(patient_map$model,Cc)"},{"path":"https://levenc.github.io/posologyr/index.html","id":"dose-optimization","dir":"","previous_headings":"Bayesian dosing example","what":"Dose optimization","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"optimize gentamicin dosage patient meet two criteria: peak concentration 12 mg/L, 30 minutes 30-minute infusion. trough concentration less 0.5 mg/L. time required reach residual concentration 0.5 mg/L can estimated follows: dose required achieve target concentration can determined infusion H48. conclusion dose 240 mg 48 h first injection appropriate meet 2 criteria. examples can found : https://levenc.github.io/posologyr/","code":"poso_time_cmin(patient_data,mod_gentamicin_Xuan2003,tdm=TRUE, target_cmin = 0.5) #> $time #> [1] 44.9 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $cmin_estimate #> [1] 0.4991313 #> #> $indiv_param #> THETA_Cl THETA_V THETA_k12 THETA_k21 add_sd prop_sd ETA_Cl ETA_V #> 3 0.047 0.28 0.092 0.071 0.23 0.237 0.03701064 0.001447308 #> ETA_k12 ETA_k21 ClCr WT #> 3 0.08904703 -0.04838898 38 63 poso_dose_conc(patient_data,mod_gentamicin_Xuan2003,tdm=TRUE, target_conc = 12,duration=0.5,time_dose = 48,time_c = 49) #> $dose #> [1] 237.5902 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 12 #> #> $indiv_param #> THETA_Cl THETA_V THETA_k12 THETA_k21 add_sd prop_sd ETA_Cl ETA_V #> 3 0.047 0.28 0.092 0.071 0.23 0.237 0.03701052 0.001447305 #> ETA_k12 ETA_k21 ClCr WT #> 3 0.08904752 -0.04838936 38 63"},{"path":"https://levenc.github.io/posologyr/index.html","id":"performance-of-the-map-be-algorithm-in-posologyr","dir":"","previous_headings":"","what":"Performance of the MAP-BE algorithm in posologyr","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"posologyr showed comparable performance NONMEM MAP estimation option MAXEVAL=0: Pharmaceutics 2022, 14(2), 442; doi:10.3390/pharmaceutics14020442 Supporting data: https://github.com/levenc/posologyr-pharmaceutics","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":null,"dir":"Reference","previous_headings":"","what":"Residual error model combined 1 — error_model_comb1","title":"Residual error model combined 1 — error_model_comb1","text":"Residual error model combined 1. Constant error model proportional coefficient provided. Proportional error model constant (additive) error coefficient provided.","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Residual error model combined 1 — error_model_comb1","text":"","code":"error_model_comb1(f, sigma)"},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Residual error model combined 1 — error_model_comb1","text":"f Numeric vector, output pharmacokinetic model sigma Numeric vector coefficients residual error model","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Residual error model combined 1 — error_model_comb1","text":"Numeric vector, residual error","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Residual error model combined 1 — error_model_comb1","text":"Implements following function: g <- sigma[1] + sigma[2]*f","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":null,"dir":"Reference","previous_headings":"","what":"Residual error model combined 2 — error_model_comb2","title":"Residual error model combined 2 — error_model_comb2","text":"Residual error model combined 2.","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Residual error model combined 2 — error_model_comb2","text":"","code":"error_model_comb2(f, sigma)"},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Residual error model combined 2 — error_model_comb2","text":"f Numeric vector, output pharmacokinetic model sigma Numeric vector coefficients residual error model","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Residual error model combined 2 — error_model_comb2","text":"Numeric vector, residual error","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Residual error model combined 2 — error_model_comb2","text":"Implements following function: g <- sqrt(sigma[1]^2 + sigma[2]^2*f^2)","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_mixednm.html","id":null,"dir":"Reference","previous_headings":"","what":"Residual error model mixed (idem NONMEM) — error_model_mixednm","title":"Residual error model mixed (idem NONMEM) — error_model_mixednm","text":"Mixed residual error model, similar NONMEM implementation.","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_mixednm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Residual error model mixed (idem NONMEM) — error_model_mixednm","text":"","code":"error_model_mixednm(f, sigma)"},{"path":"https://levenc.github.io/posologyr/reference/error_model_mixednm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Residual error model mixed (idem NONMEM) — error_model_mixednm","text":"f Numeric vector, output pharmacokinetic model sigma Matrix coefficients residual error model","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_mixednm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Residual error model mixed (idem NONMEM) — error_model_mixednm","text":"Numeric vector, residual error","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the optimal dose for a selected target area under the time-concentration curve (AUC) — poso_dose_auc","title":"Estimate the optimal dose for a selected target area under the time-concentration curve (AUC) — poso_dose_auc","text":"Estimates optimal dose selected target area time-concentration curve (AUC) given population pharmacokinetic model, set individual parameters, target AUC.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the optimal dose for a selected target area under the time-concentration curve (AUC) — poso_dose_auc","text":"","code":"poso_dose_auc( dat = NULL, prior_model = NULL, tdm = FALSE, time_auc, time_dose = NULL, cmt_dose = 1, target_auc, estim_method = \"map\", nocb = FALSE, p = NULL, greater_than = TRUE, starting_time = 0, interdose_interval = NULL, add_dose = NULL, duration = 0, starting_dose = 100, indiv_param = NULL )"},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the optimal dose for a selected target area under the time-concentration curve (AUC) — poso_dose_auc","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. tdm boolean. TRUE: estimates optimal dose selected target auc selected duration following events dat, using Maximum Posteriori estimation. Setting tdm TRUE causes following occur: time_dose argument required used starting point AUC calculation instead starting_time; arguments estim_method, p, greater_than, interdose_interval, add_dose, indiv_param starting_time ignored. time_auc Numeric. duration. target AUC computed starting_time starting_time + time_auc. tdm set TRUE target AUC computed time_dose time_dose + time_auc instead. time_dose Numeric. Time dose given. used mandatory, tdm set TRUE. cmt_dose Character numeric. compartment dose administered. Must match one compartments prior model. Defaults 1. target_auc Numeric. target AUC. estim_method character string. estimation method used individual parameters. default method \"map\" Maximum Posteriori estimation, method \"prior\" simulates prior population model, \"sir\" uses Sequential Importance Resampling algorithm estimate posteriori distribution individual parameters. argument ignored indiv_param provided, tdm set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. p Numeric. proportion distribution AUC consider optimization. Mandatory estim_method=sir. argument ignored tdm set TRUE. greater_than boolean. TRUE: targets dose leading proportion p AUCs greater target_auc. Respectively, lower FALSE. argument ignored tdm set TRUE. starting_time Numeric. First point time AUC, multiple dose regimen. default zero. argument ignored tdm set TRUE, time_dose used starting point instead. interdose_interval Numeric. Time interdose interval multiple dose regimen. Must provided add_dose used. argument ignored tdm set TRUE. add_dose Numeric. Additional doses administered inter-dose interval first dose. Optional. argument ignored tdm set TRUE. duration Numeric. Duration infusion, zero-order administrations. starting_dose Numeric. Starting dose optimization algorithm. indiv_param Optional. set individual parameters : THETA, estimates ETA, covariates. argument ignored tdm set TRUE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the optimal dose for a selected target area under the time-concentration curve (AUC) — poso_dose_auc","text":"list containing following components: dose Numeric. optimal dose selected target AUC. type_of_estimate Character string. type estimate individual parameters. Either point estimate, distribution. auc_estimate vector numeric estimates AUC. Either single value (point estimate ETA), distribution. indiv_param data.frame. set individual parameters used determination optimal dose : THETA, estimates ETA, covariates","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the optimal dose for a selected target area under the time-concentration curve (AUC) — poso_dose_auc","text":"","code":"rxode2::setRxThreads(2L) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the optimal dose to reach an AUC(0-12h) of 45 h.mg/l poso_dose_auc(dat=df_patient01,prior_model=mod_run001, time_auc=12,target_auc=45) #> #> #> #> #> $dose #> [1] 396.0027 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 45 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 1 4 70 1 0.2236068 0.6018995 -0.4291782 0.1278321 #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the optimal dose for a selected target concentration — poso_dose_conc","title":"Estimate the optimal dose for a selected target concentration — poso_dose_conc","text":"Estimates optimal dose selected target concentration selected point time given population pharmacokinetic model, set individual parameters, selected point time, target concentration.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the optimal dose for a selected target concentration — poso_dose_conc","text":"","code":"poso_dose_conc( dat = NULL, prior_model = NULL, tdm = FALSE, time_c, time_dose = NULL, target_conc, cmt_dose = 1, endpoint = \"Cc\", estim_method = \"map\", nocb = FALSE, p = NULL, greater_than = TRUE, starting_dose = 100, interdose_interval = NULL, add_dose = NULL, duration = 0, indiv_param = NULL )"},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the optimal dose for a selected target concentration — poso_dose_conc","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. tdm boolean. TRUE: estimates optimal dose selected target concentration selected point time following events dat, using Maximum Posteriori estimation. Setting tdm TRUE causes following occur: arguments estim_method, p, greater_than, interdose_interval, add_dose, indiv_param starting_time ignored. time_c Numeric. Point time dose optimized. time_dose Numeric. Time dose given. target_conc Numeric. Target concentration. cmt_dose Character numeric. compartment dose administered. Must match one compartments prior model. Defaults 1. endpoint Character. endpoint prior model optimised . default \"Cc\", central concentration. estim_method character string. estimation method used individual parameters. default method \"map\" Maximum Posteriori estimation, method \"prior\" simulates prior population model, \"sir\" uses Sequential Importance Resampling algorithm estimate posteriori distribution individual parameters. argument ignored indiv_param provided tdm set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. p Numeric. proportion distribution concentrations consider optimization. Mandatory estim_method=sir. argument ignored tdm set TRUE. greater_than boolean. TRUE: targets dose leading proportion p concentrations greater target_conc. Respectively, lower FALSE. argument ignored tdm set TRUE. starting_dose Numeric. Starting dose optimization algorithm. interdose_interval Numeric. Time interdose interval multiple dose regimen. Must provided add_dose used. argument ignored tdm set TRUE. add_dose Numeric. Additional doses administered inter-dose interval first dose. Optional. argument ignored tdm set TRUE. duration Numeric. Duration infusion, zero-order administrations. indiv_param Optional. set individual parameters : THETA, estimates ETA, covariates. argument ignored tdm set TRUE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the optimal dose for a selected target concentration — poso_dose_conc","text":"list containing following components: dose Numeric. optimal dose selected target concentration. type_of_estimate Character string. type estimate individual parameters. Either point estimate, distribution. conc_estimate vector numeric estimates conc. Either single value (point estimate ETA), distribution. indiv_param data.frame. set individual parameters used determination optimal dose : THETA, estimates ETA, covariates","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the optimal dose for a selected target concentration — poso_dose_conc","text":"","code":"rxode2::setRxThreads(2L) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the optimal dose to reach a concentration of 80 mg/l # one hour after starting the 30-minutes infusion poso_dose_conc(dat=df_patient01,prior_model=mod_run001, time_c=1,duration=0.5,target_conc=80) #> #> #> #> #> $dose #> [1] 6886.024 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 80 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 1 4 70 1 0.2236068 0.6019041 -0.4291723 0.1278484 #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"Estimates Maximum Posteriori (MAP) individual parameters, also known Empirical Bayes Estimates (EBE).","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"","code":"poso_estim_map( dat = NULL, prior_model = NULL, return_model = TRUE, return_ofv = FALSE, nocb = FALSE )"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. return_model boolean. Returns rxode2 model using estimated ETAs set TRUE. return_ofv boolean. Returns Objective Function Value (OFV) set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"named list consisting one following elements depending input parameters function: $eta named vector MAP estimates individual values ETA, $model rxode2 model using estimated ETAs, $event data.table used solve returned rxode2 model.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"","code":"rxode2::setRxThreads(1) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the Maximum A Posteriori individual parameters poso_estim_map(dat=df_patient01,prior_model=mod_run001) #> #> #> #> #> $eta #> ETA_Cl ETA_Vc ETA_Ka #> 0.6019038 -0.4291730 0.1278482 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 4.0000000 70.0000000 1.0000000 0.2236068 0.6019038 -0.4291730 0.1278482 #> ── Initial Conditions ($inits): ── #> depot centr AUC #> 0 0 0 #> ── First part of data (object): ── #> # A tibble: 151 × 13 #> time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot centr #> #> 1 0 4 70 1 7.30 45.6 1.14 0.160 0 0 0 0 #> 2 0.1 4 70 1 7.30 45.6 1.14 0.160 0.478 0.478 378. 21.8 #> 3 0.2 4 70 1 7.30 45.6 1.14 0.160 1.83 1.83 716. 83.5 #> 4 0.3 4 70 1 7.30 45.6 1.14 0.160 3.95 3.95 1017. 180. #> 5 0.4 4 70 1 7.30 45.6 1.14 0.160 6.75 6.75 1286. 307. #> 6 0.5 4 70 1 7.30 45.6 1.14 0.160 10.1 10.1 1526. 461. #> # ℹ 145 more rows #> # ℹ 1 more variable: AUC #> #> $event #> id time amt evid dur #> #> 1: 1 0.0 NA 0 NA #> 2: 1 0.0 2000 1 0.5 #> 3: 1 0.1 NA 0 NA #> 4: 1 0.2 NA 0 NA #> 5: 1 0.3 NA 0 NA #> --- #> 148: 1 14.6 NA 0 NA #> 149: 1 14.7 NA 0 NA #> 150: 1 14.8 NA 0 NA #> 151: 1 14.9 NA 0 NA #> 152: 1 15.0 NA 0 NA #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"Estimates posterior distribution individual parameters Markov Chain Monte Carlo (using Metropolis-Hastings algorithm)","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"","code":"poso_estim_mcmc( dat = NULL, prior_model = NULL, return_model = TRUE, burn_in = 50, n_iter = 1000, n_chains = 4, nocb = FALSE, control = list(n_kernel = c(2, 2, 2), stepsize_rw = 0.4, proba_mcmc = 0.3, nb_max = 3) )"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. return_model boolean. Returns rxode2 model using estimated ETAs set TRUE. burn_in Number burn-iterations Metropolis-Hastings algorithm. n_iter Total number iterations (following burn-iterations) Markov chain Metropolis-Hastings algorithm. n_chains Number Markov chains nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. control list parameters controlling Metropolis-Hastings algorithm.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"return_model set FALSE, list one element: dataframe $eta ETAs posterior distribution, estimated Markov Chain Monte Carlo. return_model set TRUE, list dataframe posterior distribution ETA, rxode2 model using estimated distributions ETAs.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"Comets E, Lavenu , Lavielle M. Parameter estimation nonlinear mixed effect models using saemix, R implementation SAEM algorithm. Journal Statistical Software 80, 3 (2017), 1-41.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"Emmanuelle Comets, Audrey Lavenu, Marc Lavielle, Cyril Leven","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"","code":"# model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the posterior distribution of population parameters poso_estim_mcmc(dat=df_patient01,prior_model=mod_run001, n_iter=50,n_chains=2) #> #> #> #> #> $eta #> ETA_Cl ETA_Vc ETA_Ka #> 1 0.40129734 -0.221078172 0.930425874 #> 2 0.46219626 -0.408861774 0.919479583 #> 3 0.46733199 -0.303257501 0.231586070 #> 4 0.70605689 -0.389072743 0.231586070 #> 5 0.71226862 -0.460682597 0.220690179 #> 6 0.45848168 -0.156826054 0.655923830 #> 7 0.71578116 -0.356073917 0.443066290 #> 8 0.39429314 -0.250227766 0.029447638 #> 9 0.79934008 -0.300123505 0.029447638 #> 10 0.64891523 -0.602467643 -0.257596645 #> 11 0.68534557 -0.393584606 0.471011853 #> 12 0.41497705 -0.469426296 0.200708751 #> 13 -0.28560298 -0.336731063 0.574758130 #> 14 0.69972327 -0.384404332 -0.094838457 #> 15 0.56697115 -0.427648209 -0.154894296 #> 16 0.52583412 -0.193851708 0.029564358 #> 17 0.73647568 -0.145748104 0.240492264 #> 18 0.72223572 -0.174057317 0.765403502 #> 19 0.61003356 -0.349027845 0.290769918 #> 20 0.69904470 -0.047834356 0.422258849 #> 21 0.43859699 -0.612412417 -0.098503394 #> 22 0.69096316 -0.051944909 0.914823122 #> 23 0.54729672 0.005972018 0.337291445 #> 24 0.27761493 -0.237833012 0.271761486 #> 25 0.64326906 0.011240352 0.623424475 #> 26 0.61126409 -0.364932526 -0.290915542 #> 27 0.36850878 -0.351410700 0.388243848 #> 28 0.27661006 -0.581498663 -0.230915305 #> 29 -0.23732985 -0.526465862 0.407033222 #> 30 0.19616325 -0.645638552 -0.494479393 #> 31 0.47330453 -0.034944362 0.470257171 #> 32 0.33639400 -0.515573239 -0.050276895 #> 33 0.78830319 -0.387354276 -0.031447965 #> 34 0.48064119 -0.343826881 0.244052299 #> 35 0.60189998 0.034441740 0.469481783 #> 36 0.77837261 -0.215748962 0.185718893 #> 37 0.75914818 -0.176417195 0.302207225 #> 38 0.68090244 -0.346820687 0.036191074 #> 39 0.54490321 -0.629963624 0.473465262 #> 40 0.49828937 -0.283363262 0.356249587 #> 41 0.54257518 -0.494014971 0.374892911 #> 42 0.62410466 -0.260718197 0.409061732 #> 43 0.15855684 -0.878222982 -0.131889899 #> 44 0.75140183 -0.141857343 0.326987451 #> 45 0.07179731 -0.032165060 0.268610671 #> 46 0.41210387 -0.258656564 0.462389655 #> 47 0.74462060 -0.382517639 0.673070802 #> 48 0.78287745 -0.073199344 0.521618599 #> 49 0.73952962 0.231836592 0.907839064 #> 50 0.53905726 -0.042012025 0.483275077 #> 51 0.00000000 0.000000000 0.000000000 #> 52 0.42534184 -0.403708105 1.056572451 #> 53 0.55618191 -0.264477715 0.046032939 #> 54 0.45520633 -0.679464662 -0.016242431 #> 55 0.44009565 -0.409873762 0.340896578 #> 56 0.57429692 -0.387726602 0.613547280 #> 57 0.54488941 -0.287829000 0.140149483 #> 58 0.48402318 -0.798975605 0.161344579 #> 59 0.56660040 -0.479785996 0.138614462 #> 60 0.61758410 -0.297867848 0.278458135 #> 61 0.73780864 0.023043168 0.551507628 #> 62 0.68002525 -0.319894513 0.234239231 #> 63 0.89503107 -0.037166313 0.600292939 #> 64 0.78780453 -0.263742002 0.175122402 #> 65 0.51360658 0.052946634 0.892954576 #> 66 0.64420451 -0.318996298 0.650988522 #> 67 0.68813422 -0.251065357 0.415733557 #> 68 0.78325406 0.094584973 0.439275927 #> 69 0.48416155 -0.480703520 0.124244451 #> 70 0.48645250 -0.663751410 0.007279203 #> 71 0.42371624 -0.511424673 0.239185177 #> 72 0.79998492 -0.327110133 -0.287008745 #> 73 0.55606168 -0.300343887 -0.103813643 #> 74 -0.18397797 -0.957175830 0.033660836 #> 75 0.33043554 -0.828096146 -0.054257139 #> 76 0.18819311 -0.839629729 0.143333722 #> 77 0.08262417 -0.414383051 -0.225163689 #> 78 0.37230513 -0.375817501 0.666112298 #> 79 0.51699274 -0.934285571 -0.299695700 #> 80 0.08783468 -0.800477076 -0.147109306 #> 81 0.68133590 -0.368815872 0.040840687 #> 82 0.65031284 -0.323466120 0.398707403 #> 83 0.52147855 -0.586734782 -0.127577976 #> 84 0.71718247 -0.171249178 0.372917693 #> 85 0.52524631 -0.377795316 0.640937425 #> 86 0.80589852 0.156365752 0.993932092 #> 87 0.43878864 -0.746336825 0.356184103 #> 88 0.13803478 -0.812773685 0.083051161 #> 89 0.49241332 -0.249973773 0.507466133 #> 90 0.81523875 -0.116686814 0.532386442 #> 91 0.28613945 -0.434134521 -0.055910865 #> 92 0.16400899 -0.611578714 -0.265540778 #> 93 0.49782289 -0.500626081 0.300302428 #> 94 0.69449874 -0.069173401 0.542000876 #> 95 0.44901310 -0.630662806 -0.542320029 #> 96 0.39487244 0.142613375 1.402640547 #> 97 0.64429477 -0.461460431 0.136638918 #> 98 0.57768550 -0.319792195 0.097921632 #> 99 0.56412639 -0.496782084 -0.041628981 #> 100 0.32575969 -0.106694594 0.762696118 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> # A tibble: 100 × 8 #> sim.id THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> #> 1 1 4 70 1 0.224 0.401 -0.221 0.930 #> 2 2 4 70 1 0.224 0.462 -0.409 0.919 #> 3 3 4 70 1 0.224 0.467 -0.303 0.232 #> 4 4 4 70 1 0.224 0.706 -0.389 0.232 #> 5 5 4 70 1 0.224 0.712 -0.461 0.221 #> 6 6 4 70 1 0.224 0.458 -0.157 0.656 #> 7 7 4 70 1 0.224 0.716 -0.356 0.443 #> 8 8 4 70 1 0.224 0.394 -0.250 0.0294 #> 9 9 4 70 1 0.224 0.799 -0.300 0.0294 #> 10 10 4 70 1 0.224 0.649 -0.602 -0.258 #> # ℹ 90 more rows #> ── Initial Conditions ($inits): ── #> depot centr AUC #> 0 0 0 #> #> Simulation without uncertainty in parameters, omega, or sigma matricies #> #> ── First part of data (object): ── #> # A tibble: 200 × 14 #> sim.id time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot #> #> 1 1 1 4 70 1 5.98 56.1 2.54 0.106 28.4 28.4 3.19e+2 #> 2 1 14 4 70 1 5.98 56.1 2.54 0.106 8.61 8.61 7.99e-9 #> 3 2 1 4 70 1 6.35 46.5 2.51 0.137 33.7 33.7 3.25e+2 #> 4 2 14 4 70 1 6.35 46.5 2.51 0.137 6.96 6.96 -2.81e-9 #> 5 3 1 4 70 1 6.38 51.7 1.26 0.123 22.2 22.2 7.90e+2 #> 6 3 14 4 70 1 6.38 51.7 1.26 0.123 7.85 7.85 6.03e-5 #> # ℹ 194 more rows #> # ℹ 2 more variables: centr , AUC #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"Estimates posterior distribution individual parameters Sequential Importance Resampling (SIR)","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"","code":"poso_estim_sir( dat = NULL, prior_model = NULL, n_sample = 10000, n_resample = 1000, return_model = TRUE, nocb = FALSE )"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. n_sample Number samples S-step n_resample Number samples R-step return_model boolean. Returns rxode2 model using estimated ETAs set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"return_model set FALSE, list one element: dataframe $eta ETAs posterior distribution, estimated Sequential Importance Resampling. return_model set TRUE, list dataframe posterior distribution ETA, rxode2 model using estimated distributions ETAs.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"","code":"# model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the posterior distribution of population parameters poso_estim_sir(dat=df_patient01,prior_model=mod_run001, n_sample=1e3,n_resample=1e2) #> #> #> #> #> $eta #> ETA_Cl ETA_Vc ETA_Ka #> 1 0.6504014 -0.46513521 0.43653693 #> 2 0.7998906 -0.03341945 0.16662057 #> 3 0.5739246 -0.05601440 0.71549851 #> 4 0.7089199 -0.17563653 0.37654151 #> 5 0.6224641 -0.44103680 0.11062341 #> 6 0.5756166 -0.54744862 -0.11639086 #> 7 0.2097388 -0.80535811 -0.39535473 #> 8 0.4410245 -0.51368224 0.18837049 #> 9 0.8041649 -0.20072306 0.23829165 #> 10 0.3270809 -0.20504934 0.30219971 #> 11 0.6224641 -0.44103680 0.11062341 #> 12 0.6901039 -0.30108197 -0.14402225 #> 13 0.5756166 -0.54744862 -0.11639086 #> 14 0.6224641 -0.44103680 0.11062341 #> 15 0.7089199 -0.17563653 0.37654151 #> 16 0.7740971 -0.30891172 0.57370521 #> 17 0.6504014 -0.46513521 0.43653693 #> 18 0.6280538 -0.23392662 0.44682453 #> 19 0.7089199 -0.17563653 0.37654151 #> 20 0.3976482 -0.64529135 0.23007851 #> 21 0.3425794 -0.70136613 0.12968425 #> 22 0.5716248 -0.36818884 0.36830570 #> 23 0.2097388 -0.80535811 -0.39535473 #> 24 0.8530497 -0.23492316 0.25581125 #> 25 0.6354166 -0.31357126 0.73866202 #> 26 0.6280538 -0.23392662 0.44682453 #> 27 0.5756166 -0.54744862 -0.11639086 #> 28 0.8530497 -0.23492316 0.25581125 #> 29 0.6354166 -0.31357126 0.73866202 #> 30 0.5480420 -0.78238693 -0.54016365 #> 31 0.6504014 -0.46513521 0.43653693 #> 32 0.6956159 -0.25114851 0.92671472 #> 33 0.3653215 -0.46129773 0.18425818 #> 34 0.4621170 -0.71068616 0.26608879 #> 35 0.2319779 -0.86032500 -0.48170475 #> 36 0.6956159 -0.25114851 0.92671472 #> 37 0.3313779 -0.54665431 0.48542548 #> 38 0.7089199 -0.17563653 0.37654151 #> 39 0.6947877 -0.46349506 0.19509695 #> 40 0.4179024 -0.58931306 0.22519506 #> 41 0.6224641 -0.44103680 0.11062341 #> 42 0.5480420 -0.78238693 -0.54016365 #> 43 0.3653215 -0.46129773 0.18425818 #> 44 0.4796500 -0.65544436 -0.11063743 #> 45 0.4737102 -0.05879126 0.68993753 #> 46 0.6224641 -0.44103680 0.11062341 #> 47 0.8041649 -0.20072306 0.23829165 #> 48 0.6441458 -0.17385456 0.07400396 #> 49 0.5480420 -0.78238693 -0.54016365 #> 50 0.5480420 -0.78238693 -0.54016365 #> 51 0.7089199 -0.17563653 0.37654151 #> 52 0.3769539 -0.82826593 0.23448758 #> 53 0.6834596 -0.07578277 0.01909532 #> 54 0.2527094 -0.21569803 0.25635943 #> 55 0.6431052 -0.37166373 -0.12400846 #> 56 0.4410245 -0.51368224 0.18837049 #> 57 0.7740971 -0.30891172 0.57370521 #> 58 0.2319779 -0.86032500 -0.48170475 #> 59 0.5716248 -0.36818884 0.36830570 #> 60 0.6280538 -0.23392662 0.44682453 #> 61 0.5756166 -0.54744862 -0.11639086 #> 62 0.5716248 -0.36818884 0.36830570 #> 63 0.6014266 -0.46330347 0.48532615 #> 64 0.4621170 -0.71068616 0.26608879 #> 65 0.2708922 -0.52232311 -0.08780402 #> 66 0.5739246 -0.05601440 0.71549851 #> 67 0.5716248 -0.36818884 0.36830570 #> 68 0.3946202 -0.37801414 0.10956928 #> 69 0.6631807 0.37417320 1.32753128 #> 70 0.6224641 -0.44103680 0.11062341 #> 71 0.6177660 0.34344899 0.79709830 #> 72 0.4796500 -0.65544436 -0.11063743 #> 73 0.6280538 -0.23392662 0.44682453 #> 74 0.2324490 -0.80580463 -0.28471752 #> 75 0.3270809 -0.20504934 0.30219971 #> 76 0.6224641 -0.44103680 0.11062341 #> 77 0.7089199 -0.17563653 0.37654151 #> 78 0.6224641 -0.44103680 0.11062341 #> 79 0.5716248 -0.36818884 0.36830570 #> 80 0.5716248 -0.36818884 0.36830570 #> 81 0.5756166 -0.54744862 -0.11639086 #> 82 0.3769539 -0.82826593 0.23448758 #> 83 0.6947877 -0.46349506 0.19509695 #> 84 0.6504014 -0.46513521 0.43653693 #> 85 0.5756166 -0.54744862 -0.11639086 #> 86 0.6224641 -0.44103680 0.11062341 #> 87 0.2944519 -0.31777262 0.32041506 #> 88 0.5065188 -0.43510689 0.59017798 #> 89 0.6354166 -0.31357126 0.73866202 #> 90 0.5065188 -0.43510689 0.59017798 #> 91 0.3951683 -0.42558280 0.21811956 #> 92 0.2486862 -0.80758491 -0.05621151 #> 93 0.7089199 -0.17563653 0.37654151 #> 94 0.4796500 -0.65544436 -0.11063743 #> 95 0.5065188 -0.43510689 0.59017798 #> 96 0.3946202 -0.37801414 0.10956928 #> 97 0.2196114 -0.43600196 0.46038729 #> 98 0.1867108 -0.72833532 0.32243635 #> 99 0.2496268 -0.29416330 0.40590506 #> 100 0.6014266 -0.46330347 0.48532615 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> # A tibble: 100 × 8 #> sim.id THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> #> 1 1 4 70 1 0.224 0.650 -0.465 0.437 #> 2 2 4 70 1 0.224 0.800 -0.0334 0.167 #> 3 3 4 70 1 0.224 0.574 -0.0560 0.715 #> 4 4 4 70 1 0.224 0.709 -0.176 0.377 #> 5 5 4 70 1 0.224 0.622 -0.441 0.111 #> 6 6 4 70 1 0.224 0.576 -0.547 -0.116 #> 7 7 4 70 1 0.224 0.210 -0.805 -0.395 #> 8 8 4 70 1 0.224 0.441 -0.514 0.188 #> 9 9 4 70 1 0.224 0.804 -0.201 0.238 #> 10 10 4 70 1 0.224 0.327 -0.205 0.302 #> # ℹ 90 more rows #> ── Initial Conditions ($inits): ── #> depot centr AUC #> 0 0 0 #> #> Simulation without uncertainty in parameters, omega, or sigma matricies #> #> ── First part of data (object): ── #> # A tibble: 200 × 14 #> sim.id time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot #> #> 1 1 1 4 70 1 7.67 44.0 1.55 0.174 28.5 28.5 6.42e+2 #> 2 1 14 4 70 1 7.67 44.0 1.55 0.174 4.66 4.66 1.18e-6 #> 3 2 1 4 70 1 8.90 67.7 1.18 0.131 16.2 16.2 8.37e+2 #> 4 2 14 4 70 1 8.90 67.7 1.18 0.131 5.45 5.45 1.79e-4 #> 5 3 1 4 70 1 7.10 66.2 2.05 0.107 22.2 22.2 4.50e+2 #> 6 3 14 4 70 1 7.10 66.2 2.05 0.107 7.30 7.30 1.20e-9 #> # ℹ 194 more rows #> # ℹ 2 more variables: centr , AUC #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the optimal inter-dose interval for a given dose and a selected target trough concentration — poso_inter_cmin","title":"Estimate the optimal inter-dose interval for a given dose and a selected target trough concentration — poso_inter_cmin","text":"Estimates optimal inter-dose interval selected target trough concentration (Cmin), given dose, population pharmacokinetic model, set individual parameters, target concentration.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the optimal inter-dose interval for a given dose and a selected target trough concentration — poso_inter_cmin","text":"","code":"poso_inter_cmin( dat = NULL, prior_model = NULL, dose, target_cmin, cmt_dose = 1, endpoint = \"Cc\", estim_method = \"map\", nocb = FALSE, p = NULL, greater_than = TRUE, starting_interval = 12, add_dose = 10, duration = 0, indiv_param = NULL )"},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the optimal inter-dose interval for a given dose and a selected target trough concentration — poso_inter_cmin","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. dose Numeric. dose given. target_cmin Numeric. Target trough concentration (Cmin). cmt_dose Character numeric. compartment dose administered. Must match one compartments prior model. Defaults 1. endpoint Character. endpoint prior model optimised . default \"Cc\", central concentration. estim_method character string. estimation method used individual parameters. default method \"map\" Maximum Posteriori estimation, method \"prior\" simulates prior population model, \"sir\" uses Sequential Importance Resampling algorithm estimate posteriori distribution individual parameters. argument ignored indiv_param provided. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. p Numeric. proportion distribution concentrations consider optimization. Mandatory estim_method=sir. greater_than boolean. TRUE: targets dose leading proportion p concentrations greater target_conc. Respectively, lower FALSE. starting_interval Numeric. Starting inter-dose interval optimization algorithm. add_dose Numeric. Additional doses administered inter-dose interval first dose. duration Numeric. Duration infusion, zero-order administrations. indiv_param Optional. set individual parameters : THETA, estimates ETA, covariates.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the optimal inter-dose interval for a given dose and a selected target trough concentration — poso_inter_cmin","text":"list containing following components: interval Numeric. inter-dose interval reach target trough concentration dosing multiple dose regimen. type_of_estimate Character string. type estimate individual parameters. Either point estimate, distribution. conc_estimate vector numeric estimates conc. Either single value (point estimate ETA), distribution. indiv_param data.frame. set individual parameters used determination optimal dose : THETA, estimates ETA, covariates","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the optimal inter-dose interval for a given dose and a selected target trough concentration — poso_inter_cmin","text":"","code":"rxode2::setRxThreads(2L) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the optimal interval to reach a cmin of of 2.5 mg/l # before each administration poso_inter_cmin(dat=df_patient01,prior_model=mod_run001, dose=1500,duration=0.5,target_cmin=2.5) #> #> #> #> #> $interval #> [1] 17.76028 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 2.500425 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 1 4 70 1 0.2236068 0.6019035 -0.4291739 0.1278471 #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the prior distribution of population parameters — poso_simu_pop","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"Estimates prior distribution population parameters Monte Carlo simulations","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"","code":"poso_simu_pop( dat = NULL, prior_model = NULL, n_simul = 1000, return_model = TRUE )"},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. n_simul integer, number simulations run. n_simul =0, ETAs set 0. return_model boolean. Returns rxode2 model using simulated ETAs set TRUE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"return_model set FALSE, list one element: dataframe $eta individual values ETA. return_model set TRUE, list dataframe individual values ETA, $model rxode2 model using estimated ETAs, $event data.table used solve returned rxode2 model.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"","code":"# model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the prior distribution of population parameters poso_simu_pop(dat=df_patient01,prior_model=mod_run001,n_simul=100) #> #> #> #> #> $eta #> ETA_Cl ETA_Vc ETA_Ka #> 1 -0.626118495 0.114181258 -1.089977423 #> 2 -0.002491555 0.277966827 0.513585283 #> 3 -0.814741627 -0.110607238 -0.109209384 #> 4 -0.126429720 -0.247621892 0.281289321 #> 5 0.923507208 -0.729400635 0.229164299 #> 6 -0.833164068 -0.233451094 -0.023524289 #> 7 0.242835347 -0.408786690 0.209365022 #> 8 0.162316736 -0.583409609 0.329943601 #> 9 0.844565080 -0.043578776 -0.418523660 #> 10 -0.007133196 -0.369751261 -0.676365686 #> 11 0.418307135 0.078928106 0.108979453 #> 12 0.726073134 0.050104954 -0.059925286 #> 13 -0.854217084 -0.124878691 -0.140177303 #> 14 0.477314594 0.031320537 -0.285824640 #> 15 -0.022344982 -0.112466815 0.198919317 #> 16 1.232260201 0.020809466 0.258359350 #> 17 0.052858355 -0.854947394 0.385536795 #> 18 -0.108778777 -0.092164995 0.008576480 #> 19 0.013219971 0.245890352 -1.017015082 #> 20 1.199676043 -0.161543056 0.095415592 #> 21 0.480462085 -0.297436507 0.498174667 #> 22 -0.109968218 -0.526622321 -0.436413663 #> 23 0.476308114 0.058884898 0.218521447 #> 24 -0.760017399 -0.657733272 0.127075897 #> 25 0.598067870 0.105853796 0.589558724 #> 26 0.234299580 0.271345975 -0.049164727 #> 27 0.077002004 -0.040395591 0.860592505 #> 28 0.580658894 0.334869635 0.248751082 #> 29 -0.245188102 0.496646302 -1.168271430 #> 30 -0.069628373 0.194041413 -0.170813730 #> 31 0.189702450 0.475433666 0.468998541 #> 32 -0.017040133 0.217412406 0.748135847 #> 33 -0.158475130 0.423219641 0.588902649 #> 34 -0.132661452 -0.173167175 -0.351256162 #> 35 -0.472587094 -0.355776943 -0.785430249 #> 36 -0.308817936 -0.249787573 -0.240003136 #> 37 0.101574342 0.437578343 -0.093415162 #> 38 -0.625835383 0.115621390 -0.197578722 #> 39 0.254285588 0.951156441 0.190002471 #> 40 -0.753233600 0.111535869 0.479787852 #> 41 0.912033660 0.201001840 0.622438164 #> 42 0.190766359 0.048113024 0.009970508 #> 43 0.269943050 -0.117460907 -0.236246880 #> 44 0.085931834 -0.512596075 0.378425286 #> 45 0.036546129 -0.583666071 -0.422577520 #> 46 0.203187738 -0.382458185 -0.128303442 #> 47 0.400239006 0.030099460 -0.072751070 #> 48 -0.369984355 0.839198826 0.342762477 #> 49 0.438249957 0.591118430 -0.500749906 #> 50 0.230136035 -0.674889964 0.685462828 #> 51 0.191920539 0.054606307 -0.508934617 #> 52 -0.249551952 0.470709543 0.303069339 #> 53 0.017217521 -0.159378512 0.350098525 #> 54 0.359743811 -0.849733032 0.418495455 #> 55 -0.138212034 0.117646994 -0.800777022 #> 56 -0.352520072 -0.506702694 0.162630373 #> 57 -0.127852962 0.231508675 -0.046022156 #> 58 -0.435617165 0.568261928 0.429711796 #> 59 0.343782648 0.463282325 -0.211928742 #> 60 -0.570347095 -0.136677720 0.989133385 #> 61 -0.465848262 -0.512741053 -0.749229147 #> 62 0.682420512 0.247839297 0.891346008 #> 63 -0.068924890 1.146838273 0.474940456 #> 64 0.511028685 0.502596010 -0.177544465 #> 65 -0.368173579 -0.258885074 0.788790589 #> 66 0.059475896 0.168375618 0.509245544 #> 67 0.555109723 0.273735392 -0.192024613 #> 68 0.608416801 -0.031688406 -0.121710828 #> 69 -1.094188573 0.029286516 -0.491268116 #> 70 -0.283165888 -0.922894327 1.184638417 #> 71 -0.515815439 -0.152337889 0.351672035 #> 72 -0.568190736 0.242453072 0.033588380 #> 73 0.249775243 0.185775389 -0.649488201 #> 74 0.420920174 -0.151576730 -0.033797831 #> 75 0.017979951 0.055589127 -0.446512611 #> 76 0.551588806 0.152242459 -0.211398977 #> 77 0.316964005 -0.683771124 0.106179842 #> 78 -0.587108379 0.334081340 -0.698779487 #> 79 0.031776028 -0.286008644 -0.377983025 #> 80 0.301978609 0.515805336 -0.754227850 #> 81 -0.403751120 0.589263704 0.492019811 #> 82 0.538341344 -0.640083750 0.618456538 #> 83 0.001397963 -0.034832047 0.197412704 #> 84 0.057656072 -0.371283104 -0.225213596 #> 85 -0.533812565 -0.336180890 0.651072068 #> 86 -0.370562765 0.129591078 -0.214686445 #> 87 -0.270487910 0.652981124 0.066938642 #> 88 -0.641000683 -0.004607784 -0.094914840 #> 89 -0.405327650 -0.940111168 0.846736541 #> 90 -0.432959036 -0.045885473 0.107313183 #> 91 0.027234813 -0.973841605 -0.052708658 #> 92 0.050219756 0.003526815 0.839752588 #> 93 0.965425280 0.317393983 0.343005395 #> 94 -0.137836338 0.452580985 -0.411012369 #> 95 0.251951230 0.144218670 0.163981760 #> 96 0.505277641 -0.421050740 0.097419956 #> 97 0.632991621 -0.171610636 -0.077853793 #> 98 -0.099167163 -0.451474970 0.214986875 #> 99 0.717512770 -0.677539567 -0.633265146 #> 100 0.392106741 0.279120500 0.944639121 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> # A tibble: 100 × 8 #> sim.id THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> #> 1 1 4 70 1 0.224 -0.626 0.114 -1.09 #> 2 2 4 70 1 0.224 -0.00249 0.278 0.514 #> 3 3 4 70 1 0.224 -0.815 -0.111 -0.109 #> 4 4 4 70 1 0.224 -0.126 -0.248 0.281 #> 5 5 4 70 1 0.224 0.924 -0.729 0.229 #> 6 6 4 70 1 0.224 -0.833 -0.233 -0.0235 #> 7 7 4 70 1 0.224 0.243 -0.409 0.209 #> 8 8 4 70 1 0.224 0.162 -0.583 0.330 #> 9 9 4 70 1 0.224 0.845 -0.0436 -0.419 #> 10 10 4 70 1 0.224 -0.00713 -0.370 -0.676 #> # ℹ 90 more rows #> ── Initial Conditions ($inits): ── #> depot centr AUC #> 0 0 0 #> #> Simulation without uncertainty in parameters, omega, or sigma matricies #> #> ── First part of data (object): ── #> # A tibble: 15,100 × 14 #> sim.id time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot #> #> 1 1 0 4 70 1 2.14 78.5 0.336 0.0273 0 0 0 #> 2 1 0.1 4 70 1 2.14 78.5 0.336 0.0273 0.0847 0.0847 393. #> 3 1 0.2 4 70 1 2.14 78.5 0.336 0.0273 0.335 0.335 774. #> 4 1 0.3 4 70 1 2.14 78.5 0.336 0.0273 0.744 0.744 1141. #> 5 1 0.4 4 70 1 2.14 78.5 0.336 0.0273 1.31 1.31 1497. #> 6 1 0.5 4 70 1 2.14 78.5 0.336 0.0273 2.02 2.02 1841. #> # ℹ 15,094 more rows #> # ℹ 2 more variables: centr , AUC #> #> $event #> ── EventTable with 152 records ── #> 1 dosing records (see $get.dosing(); add with add.dosing or et) #> 151 observation times (see $get.sampling(); add with add.sampling or et) #> ── First part of : ── #> # A tibble: 152 × 5 #> id time amt evid dur #> #> 1 1 0 NA 0:Observation NA #> 2 1 0 2000 1:Dose (Add) 0.5 #> 3 1 0.1 NA 0:Observation NA #> 4 1 0.2 NA 0:Observation NA #> 5 1 0.3 NA 0:Observation NA #> 6 1 0.4 NA 0:Observation NA #> 7 1 0.5 NA 0:Observation NA #> 8 1 0.6 NA 0:Observation NA #> 9 1 0.7 NA 0:Observation NA #> 10 1 0.8 NA 0:Observation NA #> # ℹ 142 more rows #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict time to a selected trough concentration — poso_time_cmin","title":"Predict time to a selected trough concentration — poso_time_cmin","text":"Predicts time needed reach selected trough concentration (Cmin) given population pharmacokinetic model, set individual parameters, dose, target Cmin.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict time to a selected trough concentration — poso_time_cmin","text":"","code":"poso_time_cmin( dat = NULL, prior_model = NULL, tdm = FALSE, target_cmin, dose = NULL, cmt_dose = 1, endpoint = \"Cc\", estim_method = \"map\", nocb = FALSE, p = NULL, greater_than = TRUE, from = 0.2, last_time = 72, add_dose = NULL, interdose_interval = NULL, duration = 0, indiv_param = NULL )"},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict time to a selected trough concentration — poso_time_cmin","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. tdm boolean. TRUE: computes predicted time reach target trough concentration (Cmin) following last event dat, using Maximum Posteriori estimation. Setting tdm TRUE causes following occur: simulation starts time last recorded dose (TDM data) plus ; simulation stops time last recorded dose (TDM data) plus last_time; arguments dose, duration, estim_method, p, greater_than, interdose_interval, add_dose, indiv_param starting_time ignored. target_cmin Numeric. Target trough concentration (Cmin). dose Numeric. Dose administered. argument ignored tdm set TRUE. cmt_dose Character numeric. compartment dose administered. Must match one compartments prior model. Defaults 1. endpoint Character. endpoint prior model optimised . default \"Cc\", central concentration. estim_method character string. estimation method used individual parameters. default method \"map\" Maximum Posteriori estimation, method \"prior\" simulates prior population model, \"sir\" uses Sequential Importance Resampling algorithm estimate posteriori distribution individual parameters. argument ignored indiv_param provided, tdm set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. p Numeric. proportion distribution Cmin consider estimation. Mandatory estim_method=sir. argument ignored tdm set TRUE. greater_than boolean. TRUE: targets time leading proportion p cmins greater target_cmin. Respectively, lower FALSE. argument ignored tdm set TRUE. Numeric. Starting time simulation individual time-concentration profile. default value 0.2. tdm set TRUE simulation starts time last recorded dose plus . last_time Numeric. Ending time simulation individual time-concentration profile. default value 72. tdm set TRUE simulation stops time last recorded dose plus last_time. add_dose Numeric. Additional doses administered inter-dose interval first dose. Optional. argument ignored tdm set TRUE. interdose_interval Numeric. Time inter-dose interval multiple dose regimen. Must provided add_dose used. argument ignored tdm set TRUE. duration Numeric. Duration infusion, zero-order administrations. argument ignored tdm set TRUE. indiv_param Optional. set individual parameters : THETA, estimates ETA, covariates.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict time to a selected trough concentration — poso_time_cmin","text":"list containing following components: time Numeric. Time needed reach selected Cmin. type_of_estimate Character string. type estimate individual parameters. Either point estimate, distribution. cmin_estimate vector numeric estimates Cmin. Either single value (point estimate ETA), distribution. indiv_param data.frame. set individual parameters used determination time needed reach selected Cmin: THETA, estimates ETA, covariates","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict time to a selected trough concentration — poso_time_cmin","text":"","code":"rxode2::setRxThreads(2L) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # predict the time needed to reach a concentration of 2.5 mg/l # after the administration of a 2500 mg dose over a 30 minutes # infusion poso_time_cmin(dat=df_patient01,prior_model=mod_run001, dose=2500,duration=0.5,from=0.5,target_cmin=2.5) #> #> #> #> #> $time #> [1] 20.5 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $cmin_estimate #> [1] 2.489933 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 1 4 70 1 0.2236068 0.6019037 -0.4291733 0.127848 #>"},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":null,"dir":"Reference","previous_headings":"","what":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"creates posologyr error lines rxui model","code":""},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"","code":"posologyr_error_lines(line) # S3 method for class 'norm' posologyr_error_lines(line) # S3 method for class 't' posologyr_error_lines(line) # Default S3 method posologyr_error_lines(line) # S3 method for class 'rxUi' posologyr_error_lines(line)"},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"line line parse","code":""},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"error lines posology","code":""},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"Matthew L. Fidler","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-feature-1-2-4-9000","dir":"Changelog","previous_headings":"","what":"Additional feature","title":"posologyr v1.2.4.9000","text":"route administration (.e. compartment drug administered) can now specified poso_time_cmin(), poso_dose_conc(), poso_dose_auc() poso_inter_cmin().","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"documentation-1-2-4-9000","dir":"Changelog","previous_headings":"","what":"Documentation","title":"posologyr v1.2.4.9000","text":"README illustrates simple example dose adaptation vignette(\"route_of_administration\") shows select route administration optimal dosing vignette(\"population_models\") describes structure prior population models written model functions can parsed rxode2 used posologyr vignette(\"posologyr_user_defined_models\") renamed vignette(\"classic_posologyr_models\") Examples use rxode2 model functions","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"bug-fix-1-2-4-9000","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"posologyr v1.2.4.9000","text":"Fix bug poso_estim_map(), poso_estim_sir() poso_simu_pop() failed models featuring single parameter IIV.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v124","dir":"Changelog","previous_headings":"","what":"posologyr v1.2.4","title":"posologyr v1.2.4","text":"CRAN release: 2024-02-09 Add ability use rxode2 ui models poso_* functions. model parsed rxode2() package model$posologyr gives list needed poso_* functions","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"bug-fix-1-2-3","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"posologyr v1.2.3","text":"Fix bug poso_dose_conc(), poso_dose_auc() poso_inter_cmin() returned estimate target value optimized always equal zero.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"documentation-1-2-3","dir":"Changelog","previous_headings":"","what":"Documentation","title":"posologyr v1.2.3","text":"documentation poso_time_cmin(), poso_dose_conc(), poso_dose_auc() now explicitly states consequences setting tdm TRUE: parameters required, parameters ignored, parameters behave differently. functions poso_time_cmin(), poso_dose_conc(), poso_dose_auc() now return warning input parameters ignored. Fix incorrect information regarding duration AUC documentation poso_dose_auc()","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v122","dir":"Changelog","previous_headings":"","what":"posologyr v1.2.2","title":"posologyr v1.2.2","text":"CRAN release: 2023-06-12 Relax requirements NONMEM comparison test time-varying covariates account computational differences observed alternative BLAS ATLAS CRAN.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v121","dir":"Changelog","previous_headings":"","what":"posologyr v1.2.1","title":"posologyr v1.2.1","text":"CRAN release: 2023-06-05 Add reference Kang et al. (2012) doi:10.4196/kjpp.2012.16.2.97 DESCRIPTION (requested CRAN) Fix messages console internal function posologyr() (requested CRAN) Fix assignment parent environment dose optim functions, using parent.frame() (requested CRAN)","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-features-1-2-0","dir":"Changelog","previous_headings":"","what":"Additional features","title":"posologyr v1.2.0","text":"poso_estim_map(), poso_estim_sir() poso_estim_mcmc() can now estimate individual PK profiles multiple endpoints models (eg. PK-PD, parent-metabolite, blood-CSF…), using different residual error model endpoint. poso_time_cmin(), poso_dose_conc(), poso_dose_auc() poso_inter_cmin() now allow select end point interest want optimise, provided defined model.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"documentation-1-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"posologyr v1.2.0","text":"vignette(\"a_priori_dosing\") illustrates priori dose selection vignette(\"a_posteriori_dosing\") illustrates posteriori dose selection, using TDM data vignette(\"auc_based_dosing\") shows select optimal dose given target AUC using data TDM vignette(\"multiple_endpoints\") introduces new multiple endpoints feature","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"internal-changes-1-2-0","dir":"Changelog","previous_headings":"","what":"Internal changes","title":"posologyr v1.2.0","text":"description package updated","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-features-1-1-0","dir":"Changelog","previous_headings":"","what":"Additional features","title":"posologyr v1.1.0","text":"poso_time_cmin() can now estimate time needed reach selected trough concentration (Cmin) using data TDM directly poso_dose_conc() can now estimate optimal dose reach target concentration following events TDM poso_dose_auc() can now estimate optimal dose reach target auc following events TDM","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"breaking-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"posologyr v1.0.0","text":"posologyr() now internal function, exported functions take patient data prior model input parameters adaptive MAP forecasting option removed","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-features-1-0-0","dir":"Changelog","previous_headings":"","what":"Additional features","title":"posologyr v1.0.0","text":"poso_estim_map() provides rxode2 model using MAP-EBE input dataset, interpolation covariates, make plotting easier","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"internal-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Internal changes","title":"posologyr v1.0.0","text":"RxODE import updated rxode2 tests updated take account internalization posologyr() function","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"bug-fixes-1-0-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"posologyr v1.0.0","text":"poso_time_cmin(), poso_dose_auc(), poso_dose_conc(), poso_inter_cmin() longer fail models IOV","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v020","dir":"Changelog","previous_headings":"","what":"posologyr v0.2.0","title":"posologyr v0.2.0","text":"poso_estim_sir() estimates posterior distribution individual parameters Sequential Importance Resampling (SIR). roughly 25 times faster poso_estim_mcmc() 1000 samples. poso_estim_map() allows estimation individual parameters adaptive MAP forecasting (cf. doi: 10.1007/s11095-020-02908-7) adapt=TRUE. poso_simu_pop(), poso_estim_map(), poso_estim_sir() now support models inter-individual (IIV) inter-occasion variability (IOV). MASS:mvrnorm replaced mvtnorm::rmvnorm multivariate normal distributions. Input validation added exported functions. poso_estim_map() now uses method=“L-BFGS-B” optim better convergence algorithm. poso_inter_cmin() now uses method=“L-BFGS-B” optim better convergence algorithm. poso_dose_conc() new name poso_dose_ctime(). Issues #5 #6 fixed: poso_time_cmin(), poso_dose_auc(), poso_dose_conc(), poso_inter_cmin() now work prior posterior distributions ETA, point estimates (MAP). new nocb parameter added posologyr(). interpolation method time-varying covariates can either last observation carried forward (locf, RxODE default), next observation carried backward (nocb, NONMEM default). vignette(\"uncertainty_estimates\") removed. built-models removed.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v011","dir":"Changelog","previous_headings":"","what":"posologyr v0.1.1","title":"posologyr v0.1.1","text":"poso_time_cmin(), poso_dose_ctime(), poso_dose_auc() now work multiple dose regimen. poso_inter_cmin() allows optimization inter-dose interval multiple dose regimen. vignette(\"case_study_vancomycin\") illustrates AUC-based optimal dosing, multiple dose regimen, continuous intravenous infusion.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v010","dir":"Changelog","previous_headings":"","what":"posologyr v0.1.0","title":"posologyr v0.1.0","text":"First public release.","code":""}] +[{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU Affero General Public License","title":"GNU Affero General Public License","text":"Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc.  Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU Affero General Public License","text":"GNU Affero General Public License free, copyleft license software kinds works, specifically designed ensure cooperation community case network server software. licenses software practical works designed take away freedom share change works. contrast, General Public Licenses intended guarantee freedom share change versions program–make sure remains free software users. speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. Developers use General Public Licenses protect rights two steps: (1) assert copyright software, (2) offer License gives legal permission copy, distribute /modify software. secondary benefit defending users’ freedom improvements made alternate versions program, receive widespread use, become available developers incorporate. Many developers free software heartened encouraged resulting cooperation. However, case software used network servers, result may fail come . GNU General Public License permits making modified version letting public access server without ever releasing source code public. GNU Affero General Public License designed specifically ensure , cases, modified source code becomes available community. requires operator network server provide source code modified version running users server. Therefore, public use modified version, publicly accessible server, gives public access source code modified version. older license, called Affero General Public License published Affero, designed accomplish similar goals. different license, version Affero GPL, Affero released new version Affero GPL permits relicensing license. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions.","title":"GNU Affero General Public License","text":"“License” refers version 3 GNU Affero General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code.","title":"GNU Affero General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions.","title":"GNU Affero General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law.","title":"GNU Affero General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies.","title":"GNU Affero General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions.","title":"GNU Affero General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: work must carry prominent notices stating modified , giving relevant date. work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms.","title":"GNU Affero General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms.","title":"GNU Affero General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: Disclaiming warranty limiting liability differently terms sections 15 16 License; Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; Limiting use publicity purposes names licensors authors material; Declining grant rights trademark law use trade names, trademarks, service marks; Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination.","title":"GNU Affero General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies.","title":"GNU Affero General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients.","title":"GNU Affero General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents.","title":"GNU Affero General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom.","title":"GNU Affero General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_13-remote-network-interaction-use-with-the-gnu-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Remote Network Interaction; Use with the GNU General Public License.","title":"GNU Affero General Public License","text":"Notwithstanding provision License, modify Program, modified version must prominently offer users interacting remotely computer network (version supports interaction) opportunity receive Corresponding Source version providing access Corresponding Source network server charge, standard customary means facilitating copying software. Corresponding Source shall include Corresponding Source work covered version 3 GNU General Public License incorporated pursuant following paragraph. Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU General Public License single combined work, convey resulting work. terms License continue apply part covered work, work combined remain governed version 3 GNU General Public License.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License.","title":"GNU Affero General Public License","text":"Free Software Foundation may publish revised /new versions GNU Affero General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU Affero General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU Affero General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU Affero General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty.","title":"GNU Affero General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability.","title":"GNU Affero General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://levenc.github.io/posologyr/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16.","title":"GNU Affero General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"A posteriori dose selection","text":"Dosage individualization critical care patient treated amikacin suspected ventilator-associated pneumonia, using population pharmacokinetic (ppk) model Burdet et al. 2015, using data therapeutic drug monitoring (TDM).","code":"mod_amikacin_Burdet2015 <- function() { ini({ THETA_Cl=4.3 THETA_Vc=15.9 THETA_Vp=21.4 THETA_Q=12.1 ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.1, 0.01 , 0.05 , 0.01 , 0.02 , 0.2 , -0.06 , 0.004, 0.003, 0.08) add_sd <- 0.2 prop_sd <- 0.1 }) model({ TVCl = THETA_Cl*(CLCREAT4H/82)^0.7 TVVc = THETA_Vc*(TBW/78)^0.9*(PoverF/169)^0.4 TVVp = THETA_Vp TVQ = THETA_Q Cl = TVCl*exp(ETA_Cl) Vc = TVVc*exp(ETA_Vc) Vp = TVVp*exp(ETA_Vp) Q = TVQ *exp(ETA_Q) ke = Cl/Vc k12 = Q/Vc k21 = Q/Vp Cp = centr/Vc d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"patient-record-with-tdm-data","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Patient record with TDM data","title":"A posteriori dose selection","text":"first administration, dosage selection can refined using results TDM. See vignette(\"patient_data_input\") details regarding patient record. concentration measured 30 min 30 min infusion meet target peak concentration; < 60 mg/L.","code":"df_patientA <- data.frame(ID=1,TIME=c(0,1,6), DV=c(NA,58,14), EVID=c(1,0,0), AMT=c(2000,0,0), DUR=c(0.5,NA,NA), CLCREAT4H=50,TBW=62,PoverF=169) df_patientA #> ID TIME DV EVID AMT DUR CLCREAT4H TBW PoverF #> 1 1 0 NA 1 2000 0.5 50 62 169 #> 2 1 1 58 0 0 NA 50 62 169 #> 3 1 6 14 0 0 NA 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"estimate-the-map-individual-parameters","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Estimate the MAP individual parameters","title":"A posteriori dose selection","text":"maximum posteriori (MAP) individual parameters estimated.","code":"patA_map <- poso_estim_map(dat=df_patientA, prior_model=mod_amikacin_Burdet2015)"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"plot-the-individual-pharmacokinetic-profile","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Plot the individual pharmacokinetic profile","title":"A posteriori dose selection","text":"individual pharmacokinetic profile can plotted using rxode2 model provided poso_estim_map() function.","code":"plot(patA_map$model,Cc)"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"time-required-to-reach-the-target-cmin-following-the-first-administration","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Time required to reach the target Cmin following the first administration","title":"A posteriori dose selection","text":"MAP estimates individual parameters, prediction time needed reaching target Cmin can updated. next dose (needed) can administered 33.9 hours following first infusion.","code":"poso_time_cmin(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, tdm = TRUE, target_cmin = 2.5) #> $time #> [1] 33.9 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $cmin_estimate #> [1] 2.487865 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 3 4.3 15.9 21.4 12.1 0.2 0.1 0.4499479 0.2730561 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 3 0.7061648 -0.13884 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"optimal-dose-selection-a-posteriori","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Optimal dose selection a posteriori","title":"A posteriori dose selection","text":"optimal dose achieve peak concentration 80 mg/l can determined using MAP estimates. next dose 2450 mg.","code":"map_dose <- poso_dose_conc(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, tdm=TRUE, time_c = 35, #target concentration at t = 35 h time_dose = 34, #dosing at t = 34 h duration = 0.5, target_conc = 80) map_dose #> $dose #> [1] 2447.917 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 80 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 3 4.3 15.9 21.4 12.1 0.2 0.1 0.4499608 0.2730596 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 3 0.7061496 -0.1388505 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_posteriori_dosing.html","id":"interdose-interval-selection-a-posteriori","dir":"Articles","previous_headings":"A posteriori dose selection","what":"Interdose interval selection a posteriori","title":"A posteriori dose selection","text":"optimal inter-dose interval reach Cmin 2.5 mg/L dosing can determined using MAP estimates. interval doses less 38.6 hours allow adequate elimination amikacin infusion.","code":"map_interval <- poso_inter_cmin(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, dose = map_dose$dose, duration = 0.5, target_cmin = 2.5) map_interval #> $interval #> [1] 38.57781 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 2.500173 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 1 4.3 15.9 21.4 12.1 0.2 0.1 0.449952 0.2730587 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 1 0.7061588 -0.1388432 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"A priori dose selection","text":"First dose selection critical care patient treated amikacin suspected ventilator-associated pneumonia. Population pharmacokinetic (ppk) model form Burdet et al. 2015.","code":"mod_amikacin_Burdet2015 <- function() { ini({ THETA_Cl=4.3 THETA_Vc=15.9 THETA_Vp=21.4 THETA_Q=12.1 ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.1, 0.01 , 0.05 , 0.01 , 0.02 , 0.2 , -0.06 , 0.004, 0.003, 0.08) add_sd <- 0.2 prop_sd <- 0.1 }) model({ TVCl = THETA_Cl*(CLCREAT4H/82)^0.7 TVVc = THETA_Vc*(TBW/78)^0.9*(PoverF/169)^0.4 TVVp = THETA_Vp TVQ = THETA_Q Cl = TVCl*exp(ETA_Cl) Vc = TVVc*exp(ETA_Vc) Vp = TVVp*exp(ETA_Vp) Q = TVQ *exp(ETA_Q) ke = Cl/Vc k12 = Q/Vc k21 = Q/Vp Cp = centr/Vc d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"patient-record","dir":"Articles","previous_headings":"A priori dose selection","what":"Patient record","title":"A priori dose selection","text":"first administration, concentration information available. patient record contains information required fill covariates model: CLCREAT4H: 4-h creatinine clearance ml/min TBW: Total body weight kg PoverF: PaO2/FIO2 ratio mmHg","code":"df_patientA <- data.frame(ID=1,TIME=0, DV=0, EVID=0, AMT=0, CLCREAT4H=50,TBW=62,PoverF=169) df_patientA #> ID TIME DV EVID AMT CLCREAT4H TBW PoverF #> 1 1 0 0 0 0 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"optimal-dose-selection","dir":"Articles","previous_headings":"A priori dose selection","what":"Optimal dose selection","title":"A priori dose selection","text":"absence measured concentrations, optimal dose mg achieve concentration 80 mg/l one hour start 30-minute infusion determined typical profile ppk model.","code":"prior_dose <- poso_dose_conc(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, time_c = 1, #30 min after a duration = 0.5, #30 min infusion target_conc = 80) prior_dose #> $dose #> [1] 2087.669 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 80 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 1 4.3 15.9 21.4 12.1 0.2 0.1 2.025724e-07 6.573817e-08 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 1 2.011353e-07 -1.163665e-07 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"time-required-to-reach-the-target-cmin","dir":"Articles","previous_headings":"A priori dose selection","what":"Time required to reach the target Cmin","title":"A priori dose selection","text":"Following dose, time hours required reach target Cmin concentration 2.5 mg/l can estimated.","code":"poso_time_cmin(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, dose = prior_dose$dose, duration = 0.5, #30 min infusion target_cmin = 2.5) #> $time #> [1] 37.5 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $cmin_estimate #> [1] 2.49637 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add_sd prop_sd ETA_Cl ETA_Vc #> 1 4.3 15.9 21.4 12.1 0.2 0.1 -9.803026e-07 3.556777e-07 #> ETA_Vp ETA_Q CLCREAT4H TBW PoverF #> 1 -3.567767e-07 9.847164e-07 50 62 169"},{"path":"https://levenc.github.io/posologyr/articles/a_priori_dosing.html","id":"plotting-the-selected-dosage","dir":"Articles","previous_headings":"A priori dose selection","what":"Plotting the selected dosage","title":"A priori dose selection","text":"selected dose can simulated plotted. setting n_simul = 0, poso_simu_pop() function produces compiled rxode2 model without inter-individual variability, using typical population parameter values individual covariates patient record. Observations 30-minutes infusion optimal dose added rxode2 model updating rxode2 event table. Plotting simulated scenario. resulting plot can augmented ggplot2. example, adding horizontal ribbon showing 60-80 mg/l target interval 1 h peak concentration, vertical dashed line marking 1 hour. typical patient (.e. PK profile typical model population), selected dose meets peak concentration target.","code":"# generate a model using the individual covariates simu_patA <- poso_simu_pop(dat=df_patientA, prior_model=mod_amikacin_Burdet2015, n_simul = 0) simu_patA$model$time <- seq(0,20,b=0.1) simu_patA$model$add.dosing(dose=prior_dose$dose,rate=prior_dose$dose/0.5) plot(simu_patA$model,Cc) plot(simu_patA$model,Cc) + ggplot2::ylab(\"Central concentration\") + ggplot2::geom_vline(xintercept=1, linetype=\"dashed\") + ggplot2::geom_ribbon(ggplot2::aes(ymin=60, ymax=80), fill=\"seagreen\",show.legend = FALSE, alpha=0.15)"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"AUC-based dose selection","text":"AUC-based dosage adjustment patient treated vancomycin methicillin-resistant Staphylococcus aureus blood stream infection, using population pharmacokinetic (ppk) model Goti et al. 2018, using data therapeutic drug monitoring (TDM).","code":"mod_vancomycin_Goti2018 <- function() { ini({ THETA_Cl <- 4.5 THETA_Vc <- 58.4 THETA_Vp <- 38.4 THETA_Q <- 6.5 ETA_Cl ~ 0.147 ETA_Vc ~ 0.510 ETA_Vp ~ 0.282 add.sd <- 3.4 prop.sd <- 0.227 }) model({ TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) <- Cc Cc ~ add(add.sd) + prop(prop.sd) + combined1() }) }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"patient-record-with-tdm-data","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Patient record with TDM data","title":"AUC-based dose selection","text":"dosage selection can informed using results TDM. See vignette(\"patient_data_input\") details regarding patient records.","code":"df_patientB <- data.frame(ID=1,TIME=c(0.0,13.0,24.2,48), DV=c(NA,12,NA,9.5), AMT=c(2000,0,1000,0), DUR=c(2,NA,2,NA), EVID=c(1,0,1,0), CLCREAT=65,WT=70,DIAL=0) df_patientB #> ID TIME DV AMT DUR EVID CLCREAT WT DIAL #> 1 1 0.0 NA 2000 2 1 65 70 0 #> 2 1 13.0 12.0 0 NA 0 65 70 0 #> 3 1 24.2 NA 1000 2 1 65 70 0 #> 4 1 48.0 9.5 0 NA 0 65 70 0"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"estimate-the-map-individual-parameters","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Estimate the MAP individual parameters","title":"AUC-based dose selection","text":"","code":"patB_map <- poso_estim_map(dat=df_patientB, prior_model=mod_vancomycin_Goti2018)"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"plot-the-individual-pharmacokinetic-profile","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Plot the individual pharmacokinetic profile","title":"AUC-based dose selection","text":"individual pharmacokinetic profile can plotted using rxode2 model provided poso_estim_map() function. Using ggplot2 observed data points can added plot MAP profile matches observations.","code":"plot(patB_map$model,Cc) #Get the observations from the patient record indiv_obs <- df_patientB[,c(\"DV\",\"TIME\")] names(indiv_obs) <- c(\"value\",\"time\") #Overlay the MAP profile and the observations plot(patB_map$model,Cc) + ggplot2::ylab(\"Central concentration\") + ggplot2::geom_point(data=indiv_obs, size= 3, na.rm=TRUE)"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"get-the-auc24-from-the-map-model","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Get the AUC24 from the MAP model","title":"AUC-based dose selection","text":"Considering MIC 1 mg/L, target AUC 24 hours (AUC24) 400 mg.h/L. AUC can retrieved rxode2 model using usual R data.frame syntax. current dosage meet target AUC.","code":"#AUC 0_24 AUC_map_first_dose <- patB_map$model$AUC[which(patB_map$model$time == 24)] AUC_map_first_dose #> [1] 337.8965 #AUC 24_48 AUC_map_second_dose <- patB_map$model$AUC[which(patB_map$model$time == 48)] - AUC_map_first_dose AUC_map_second_dose #> [1] 325.3072"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"optimal-dose-selection-a-posteriori","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Optimal dose selection a posteriori","title":"AUC-based dose selection","text":"next dose needed achieve AUC24 400 mg.h/L can estimated using TDM data. optimal dose estimated next infusion 1411 mg.","code":"poso_dose_auc(dat=df_patientB, prior_model=mod_vancomycin_Goti2018, tdm=TRUE, time_auc=24, #AUC24 time_dose = 48, #48 h: immediately following the last observation duration=2, #infused over 2 h target_auc=400) #> $dose #> [1] 1411.593 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 400 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add.sd prop.sd ETA_Cl ETA_Vc #> 4 4.5 58.4 38.4 6.5 3.4 0.227 0.08208203 0.06122374 #> ETA_Vp CLCREAT DIAL WT #> 4 0.06285943 65 0 70"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"optimal-maintenance-dose-selection-a-posteriori","dir":"Articles","previous_headings":"Discontinuous intravenous infusion","what":"Optimal maintenance dose selection a posteriori","title":"AUC-based dose selection","text":"maintenance dose needed reliably achieve AUC24 400 mg.h/L can estimated simulating multiple dose regimen enough administrations (e.g. 11 consecutive administrations, add_dose=10) approximate steady-state. optimal maintenance dose 1200 mg.","code":"poso_dose_auc(dat=df_patientB, prior_model=mod_vancomycin_Goti2018, time_auc=24, starting_time=24*9, interdose_interval=24, add_dose=10, duration=2, target_auc=400) #> $dose #> [1] 1198.266 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 400 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add.sd prop.sd ETA_Cl ETA_Vc #> 1 4.5 58.4 38.4 6.5 3.4 0.227 0.08208199 0.06122337 #> ETA_Vp CLCREAT DIAL WT #> 1 0.0628591 65 0 70"},{"path":"https://levenc.github.io/posologyr/articles/auc_based_dosing.html","id":"continuous-intravenous-infusion","dir":"Articles","previous_headings":"","what":"Continuous intravenous infusion","title":"AUC-based dose selection","text":"maintenance dose continuous intravenous infusion can easily determined setting duration infusion equal interdose_interval. optimal maintenance dose also 1200 mg / 24 h continuous intravenous infusion.","code":"poso_dose_auc(dat=df_patientB, prior_model=mod_vancomycin_Goti2018, time_auc=24, starting_time=24*9, interdose_interval=24, add_dose=10, duration=24, target_auc=400) #> $dose #> [1] 1198.923 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 400 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Vp THETA_Q add.sd prop.sd ETA_Cl ETA_Vc #> 1 4.5 58.4 38.4 6.5 3.4 0.227 0.08208202 0.06122453 #> ETA_Vp CLCREAT DIAL WT #> 1 0.06285936 65 0 70"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Classic posologyr models","text":"Originally, posologyr models R lists; posologyr still uses format internally, ’s often useful use rxode2 syntax, even import NONMEM model using nonmem2rx package. article describes structure classical posologyr models. illustrates define published population models.","code":""},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"structure","dir":"Articles","previous_headings":"","what":"Structure","title":"Classic posologyr models","text":"posologyr model named R list following items: ppk_model rxode2 model implementing structural population model individual model (.e. model inter-individual variability) covariates error_model function residual error model, alternatively named list functions multiple endpoints model vignette(\"multiple_endpoints\") theta named vector population estimates fixed effects parameters (called THETAs, following NONMEM terminology) omega named square variance-covariance matrix population parameters inter-individual variability sigma estimates parameters residual error model pi_matrix Optional. named square variance-covariance matrix population parameters inter-occasion variability covariates character vector covariates model","code":""},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"definition-of-a-prior-model-through-an-example","dir":"Articles","previous_headings":"","what":"Definition of a prior model through an example","title":"Classic posologyr models","text":"model example two-compartment ppk model vancomycin derived retrospective study cohort 1,800 patients (doi:10.1097/FTD.0000000000000490).","code":""},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"ppk_model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"ppk_model","title":"Classic posologyr models","text":"model defined rxode2 mini-language. posologyr needs structural model, defined either differential algebraic equations, individual model. Depending model type, naming conventions less strict: Single endpoint model (e.g. pharmacokinetic models) concentration central compartment must named Cc. Multiple endpoints model (eg. PK-PD, parent-metabolite, blood-urine…) names endpoints flexible, must consistent names error models parameters. differential function d/dt(AUC) = Cc; needed optimization function poso_dose_auc().","code":"ppk_model = rxode2::rxode({ centr(0) = 0; TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) = Cc; })"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"error_model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"error_model","title":"Classic posologyr models","text":"function residual error model, taking two arguments: simulated concentrations, vector sigma estimates parameters residual error model. multiple endpoints models, error_model must named list function endpoint vignette(\"multiple_endpoints\"). obtain individual estimations multiple endpoints, consistency naming convention must maintained across following: dataset (using column DVID). residual error models (stored named list). standard deviation residual error models (stored named list, see sigma). many residual error models desired can defined. model defined named list error_models must counterpart named list sigma, names must match defined DVID column dataset.","code":"error_model <- function(f,sigma){ #additive model if sigma[2] == 0 g <- sigma[1]^2 + (sigma[2]^2)*(f^2) #proportional model if sigma[1] == 0 return(sqrt(g)) } error_model = list( first_endpoint = function(f,sigma){ g <- sigma[1]^2 + (sigma[2]^2)*(f^2) return(sqrt(g)) }, second_endpoint = function(f,sigma){ g <- sigma[1]^2 + (sigma[2]^2)*(f^2) return(sqrt(g)) } )"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"theta","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"theta","title":"Classic posologyr models","text":"estimations parameters fixed effects model (THETA), named vector. names must match names used ppk_model.","code":"theta = c(THETA_Cl=4.5, THETA_Vc=58.4, THETA_Vp=38.4, THETA_Q=6.5)"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"omega","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"omega","title":"Classic posologyr models","text":"variance-covariance matrix random effects (ETA) individual model. symmetric matrix. names must match names used ppk_model. easy way define using lotri::lotri(). estimates variances random effects can given different parameterizations depending authors. Standard deviation (SD): square root variance, returned Monolix Coefficient variation (CV): calculated sqrt(exp(SD^2)-1), variance can computed back log((CV^2)+1) Full covariance matrix: easiest reuse, less common literature case vancomycin model, estimates subject variability (BSV) given CV%. must converted variances prior inclusion omega. estimates covariance (-diagonal) sometimes given coefficients correlation ETAs. covariance ETA_a ETA_b can computed following product: standard_deviation(ETA_a) * standard_deviation(ETA_b) * correlation(ETA_a ETA_b). example, covariances equal zero.","code":"omega = lotri::lotri({ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.147, 0 , 0.510 , 0 , 0 , 0.282, 0 , 0 , 0 , 0)})"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"sigma","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"sigma","title":"Classic posologyr models","text":"estimates parameters residual error model standard deviation scale, either vector: matrix: named list (multiple endpoints): depending residual error model.","code":"sigma = c(additive_a = 3.4, proportional_b = 0.227) sigma = lotri::lotri({prop + add ~ c(0.227,0.0,3.4)}) sigma = list( first_endpoint=c(additive_a = 0.144, proportional_b = 0.15), second_endpoint=c(additive_a = 3.91, proportional_b = 0.0) )"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"pi_matrix","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"pi_matrix","title":"Classic posologyr models","text":"Optional: needed models inter-occasion variability (IOV). variance-covariance matrix random effects (KAPPA) IOV. omega matrix, names must match names used ppk_model. easy way define using lotri::lotri().","code":"pi_matrix = lotri::lotri({KAPPA_Cl + KAPPA_Vc ~ c(0.1934626, 0.00 , 0.05783106)})"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"covariates","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"covariates","title":"Classic posologyr models","text":"names every covariate defined ppk_model, character vector.","code":"covariates = c(\"CLCREAT\",\"WT\",\"DIAL\")"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"full-model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"Full model","title":"Classic posologyr models","text":"posologyr model list objects. Note: model include inter-occasion variability, pi_matrix omitted.","code":"mod_vancomyin_Goti2018 <- list( ppk_model = rxode2::rxode({ centr(0) = 0; TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) = Cc; }), error_model = function(f,sigma){ g <- sigma[1] + sigma[2]*f return(g) }, theta = c(THETA_Cl=4.5, THETA_Vc=58.4, THETA_Vp=38.4,THETA_Q=6.5), omega = lotri::lotri({ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.147, 0 , 0.510 , 0 , 0 , 0.282, 0 , 0 , 0 , 0)}), sigma = c(additive_a = 3.4, proportional_b = 0.227), covariates = c(\"CLCREAT\",\"WT\",\"DIAL\"))"},{"path":"https://levenc.github.io/posologyr/articles/classic_posologyr_models.html","id":"resulting-r-object","dir":"Articles","previous_headings":"Definition of a prior model through an example > Full model","what":"Resulting R object","title":"Classic posologyr models","text":"","code":"mod_vancomyin_Goti2018 #> $ppk_model #> rxode2 NA model named rx_bce7176cfa18100af62e71ae38d3cd48 model (✔ ready). #> $state: centr, periph, AUC #> $params: THETA_Cl, CLCREAT, DIAL, THETA_Vc, WT, THETA_Vp, THETA_Q, ETA_Cl, ETA_Vc, ETA_Vp #> $lhs: TVCl, TVVc, TVVp, TVQ, Cl, Vc, Vp, Q, ke, k12, k21, Cc #> #> $error_model #> function(f,sigma){ #> g <- sigma[1] + sigma[2]*f #> return(g) #> } #> #> $theta #> THETA_Cl THETA_Vc THETA_Vp THETA_Q #> 4.5 58.4 38.4 6.5 #> #> $omega #> ETA_Cl ETA_Vc ETA_Vp ETA_Q #> ETA_Cl 0.147 0.00 0.000 0 #> ETA_Vc 0.000 0.51 0.000 0 #> ETA_Vp 0.000 0.00 0.282 0 #> ETA_Q 0.000 0.00 0.000 0 #> #> $sigma #> additive_a proportional_b #> 3.400 0.227 #> #> $covariates #> [1] \"CLCREAT\" \"WT\" \"DIAL\""},{"path":"https://levenc.github.io/posologyr/articles/multiple_endpoints.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Multiple endpoints","text":"different error model can defined multiple endpoints models (eg. PK-PD, parent-metabolite, blood-urine…). example can seen , utilizing warfarin data model (provided Tomoo Funaki Nick Holford) nlmixr documentation (https://nlmixr2.org/articles/multiple-endpoints.html).","code":""},{"path":"https://levenc.github.io/posologyr/articles/multiple_endpoints.html","id":"warfarin-pkpd-model","dir":"Articles","previous_headings":"Introduction","what":"warfarin PKPD model","title":"Multiple endpoints","text":"","code":"mod_warfarin_nlmixr <- function() { ini({ #Fixed effects: population estimates THETA_ktr=0.106 THETA_ka=-0.087 THETA_cl=-2.03 THETA_v=2.07 THETA_emax=3.4 THETA_ec50=0.00724 THETA_kout=-2.9 THETA_e0=4.57 #Random effects: inter-individual variability ETA_ktr ~ 1.024695 ETA_ka ~ 0.9518403 ETA_cl ~ 0.5300943 ETA_v ~ 0.4785394 ETA_emax ~ 0.7134424 ETA_ec50 ~ 0.7204165 ETA_kout ~ 0.3563706 ETA_e0 ~ 0.2660827 #Unexplained residual variability cp.sd <- 0.144 cp.prop.sd <- 0.15 pca.sd <- 3.91 }) model({ #Individual model and covariates ktr <- exp(THETA_ktr + ETA_ktr) ka <- exp(THETA_ka + ETA_ka) cl <- exp(THETA_cl + ETA_cl) v <- exp(THETA_v + ETA_v) emax = expit(THETA_emax + ETA_emax) ec50 = exp(THETA_ec50 + ETA_ec50) kout = exp(THETA_kout + ETA_kout) e0 = exp(THETA_e0 + ETA_e0) #Structural model defined using ordinary differential equations (ODE) DCP = center/v PD=1-emax*DCP/(ec50+DCP) effect(0) = e0 kin = e0*kout d/dt(depot) = -ktr * depot d/dt(gut) = ktr * depot -ka * gut d/dt(center) = ka * gut - cl / v * center d/dt(effect) = kin*PD -kout*effect cp = center / v pca = effect #Model for unexplained residual variability cp ~ add(cp.sd) + prop(cp.prop.sd) pca ~ add(pca.sd) }) }"},{"path":"https://levenc.github.io/posologyr/articles/multiple_endpoints.html","id":"data-first-subject-from-the-warfarin-dataset","dir":"Articles","previous_headings":"Introduction","what":"data: first subject from the warfarin dataset","title":"Multiple endpoints","text":"posologyr can compute EBE combined PKPD model poso_estim_map() observation/time curves endpoints can also plotted","code":"warf_01 <- data.frame(ID=1, TIME=c(0.0,1.0,3.0,6.0,24.0,24.0,36.0,36.0,48.0,48.0,72.0,72.0,144.0), DV=c(0.0,1.9,6.6,10.8,5.6,44.0,4.0,27.0,2.7,28.0,0.8,31.0,71.0), DVID=c(\"cp\",\"cp\",\"cp\",\"cp\",\"cp\",\"pca\",\"cp\",\"pca\",\"cp\",\"pca\",\"cp\",\"pca\",\"pca\"), EVID=c(1,0,0,0,0,0,0,0,0,0,0,0,0), AMT=c(100,0,0,0,0,0,0,0,0,0,0,0,0)) warf_01 #> ID TIME DV DVID EVID AMT #> 1 1 0 0.0 cp 1 100 #> 2 1 1 1.9 cp 0 0 #> 3 1 3 6.6 cp 0 0 #> 4 1 6 10.8 cp 0 0 #> 5 1 24 5.6 cp 0 0 #> 6 1 24 44.0 pca 0 0 #> 7 1 36 4.0 cp 0 0 #> 8 1 36 27.0 pca 0 0 #> 9 1 48 2.7 cp 0 0 #> 10 1 48 28.0 pca 0 0 #> 11 1 72 0.8 cp 0 0 #> 12 1 72 31.0 pca 0 0 #> 13 1 144 71.0 pca 0 0 map_warf_01 <- poso_estim_map(warf_01,mod_warfarin_nlmixr) map_warf_01 #> $eta #> ETA_ktr ETA_ka ETA_cl ETA_v ETA_emax ETA_ec50 #> -0.32052193 -0.54227235 0.79432182 -0.02986447 0.02383273 -0.28133882 #> ETA_kout ETA_e0 #> -0.30872226 -0.08386652 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> THETA_ktr THETA_ka THETA_cl THETA_v THETA_emax THETA_ec50 #> 0.10600000 -0.08700000 -2.03000000 2.07000000 3.40000000 0.00724000 #> THETA_kout THETA_e0 cp.sd cp.prop.sd pca.sd ETA_ktr #> -2.90000000 4.57000000 0.14400000 0.15000000 3.91000000 -0.32052193 #> ETA_ka ETA_cl ETA_v ETA_emax ETA_ec50 ETA_kout #> -0.54227235 0.79432182 -0.02986447 0.02383273 -0.28133882 -0.30872226 #> ETA_e0 #> -0.08386652 #> ── Initial Conditions ($inits): ── #> depot gut center effect #> 0 0 0 0 #> ── First part of data (object): ── #> # A tibble: 1,451 × 18 #> time ktr ka cl v emax ec50 kout e0 DCP PD kin #> #> 1 0 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0 1 3.59 #> 2 0.1 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.0267 0.967 3.59 #> 3 0.2 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.102 0.885 3.59 #> 4 0.3 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.219 0.783 3.59 #> 5 0.4 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.373 0.681 3.59 #> 6 0.5 0.807 0.533 0.291 7.69 0.968 0.760 0.0404 88.8 0.557 0.590 3.59 #> # ℹ 1,445 more rows #> # ℹ 6 more variables: cp , pca , depot , gut , #> # center , effect #> #> $event #> id time amt evid #> #> 1: 1 0.0 NA 0 #> 2: 1 0.0 100 1 #> 3: 1 0.1 NA 0 #> 4: 1 0.2 NA 0 #> 5: 1 0.3 NA 0 #> --- #> 1448: 1 144.6 NA 0 #> 1449: 1 144.7 NA 0 #> 1450: 1 144.8 NA 0 #> 1451: 1 144.9 NA 0 #> 1452: 1 145.0 NA 0 plot(map_warf_01$model,\"cp\") plot(map_warf_01$model,\"pca\")"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Patient data","text":"describes structure patient records compatible posologyr.","code":""},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"structure","dir":"Articles","previous_headings":"","what":"Structure","title":"Patient data","text":"Data input posologyr type data input rxode2. stated rxode2 documentation (rxode2 datasets), also similar data NONMEM. patient dataset table sequential event records, line event. description different event types available rxode2 documentation (rxode2 Event Types). minimal working example:","code":"data.frame(ID=1, TIME=c(0.0,3), DV=c(NA,60.0), AMT=c(1000,0), EVID=c(101,0)) #> ID TIME DV AMT EVID #> 1 1 0 NA 1000 101 #> 2 1 3 60 0 0"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"required-fields-and-data","dir":"Articles","previous_headings":"Structure","what":"Required fields and data","title":"Patient data","text":"TIME Dosing times, sampling times therapeutic drug monitoring (TDM). units depend specification population pharmacokinetics (ppk) model. AMT Amount drug administered. units depend specification ppk model. EVID Event type. Must 0 observations (concentrations TDM). DV concentrations. Must NA EVID 0. Covariates Every covariate defined prior posologyr model. column names must match covariate vector ppk model. OCC Occasions. Required models inter-occasion variability. DVID Observation type. Required models multiple endpoints. CMT Name (number) compartment dose administered, see vignette(\"route_of_administration\").","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"a-priori-dose-adjustment","dir":"Articles","previous_headings":"Common use cases","what":"A priori dose adjustment","title":"Patient data","text":"dosing: simplest patient record single line dataframe, individual patient covariates, columns (TIME, DV, AMT, EVID) set zero.","code":"data.frame(ID=1, TIME=0, DV=0, AMT=0, EVID=0, COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID COVAR1 COVAR2 #> 1 1 0 0 0 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"oral-administration-or-iv-bolus","dir":"Articles","previous_headings":"Common use cases","what":"Oral administration or IV bolus","title":"Patient data","text":"EVID = 1 instantaneous administration first compartment defined ppk model: either central compartment IV bolus, depot compartment oral administration.","code":"data.frame(ID=1, TIME=c(0.0,3), DV=c(NA,60.0), AMT=c(1000,0), EVID=c(1,0), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID COVAR1 COVAR2 #> 1 1 0 NA 1000 1 X Y #> 2 1 3 60 0 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"intermittent-infusion","dir":"Articles","previous_headings":"Common use cases","what":"Intermittent infusion","title":"Patient data","text":"EVID = 1 bolus infusion, administered first compartment defined ppk model. DUR defines duration. AMT amount administered duration DUR.","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(1000,0,0), DUR=c(0.5,NA,NA), EVID=c(1,0,0), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT DUR EVID COVAR1 COVAR2 #> 1 1 0 NA 1000 0.5 1 X Y #> 2 1 1 25.0 0 NA 0 X Y #> 3 1 14 5.5 0 NA 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"inter-occasion-variability","dir":"Articles","previous_headings":"Common use cases","what":"Inter-occasion variability","title":"Patient data","text":"given occasion, value OCC must repeated row. OCC must specified rows table.","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0,24.0,25.0,36.0), DV=c(NA,25.0,5.5,NA,30.0,6.0), AMT=c(1000,0,0,1000,0,0), DUR=c(0.5,NA,NA,0.5,NA,NA), EVID=c(1,0,0,1,0,0), OCC=c(1,1,1,2,2,2), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT DUR EVID OCC COVAR1 COVAR2 #> 1 1 0 NA 1000 0.5 1 1 X Y #> 2 1 1 25.0 0 NA 0 1 X Y #> 3 1 14 5.5 0 NA 0 1 X Y #> 4 1 24 NA 1000 0.5 1 2 X Y #> 5 1 25 30.0 0 NA 0 2 X Y #> 6 1 36 6.0 0 NA 0 2 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data.html","id":"multiple-endpoints","dir":"Articles","previous_headings":"Common use cases","what":"Multiple endpoints","title":"Patient data","text":"DVID used specify type observation. values DVID dataset must match names residual error models, see vignette(\"multiple_endpoints\").","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0,24.0,25.0,36.0), DV=c(NA,20.0,80,35.5,60.0,40.0), AMT=c(1000,0,0,0,0,0), EVID=c(1,0,0,0,0,0), DVID=c(\"parent\",\"parent\",\"metabolite\",\"parent\",\"metabolite\",\"metabolite\"), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID DVID COVAR1 COVAR2 #> 1 1 0 NA 1000 1 parent X Y #> 2 1 1 20.0 0 0 parent X Y #> 3 1 14 80.0 0 0 metabolite X Y #> 4 1 24 35.5 0 0 parent X Y #> 5 1 25 60.0 0 0 metabolite X Y #> 6 1 36 40.0 0 0 metabolite X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Patient records","text":"describes structure patient records usable posologyr.","code":""},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"structure","dir":"Articles","previous_headings":"","what":"Structure","title":"Patient records","text":"Data input posologyr type data input rxode2. stated rxode2 documentation (rxode2 datasets), also similar data NONMEM. patient dataset table sequential event records, line event. description different event types available rxode2 documentation (rxode2 Event Types). minimal working example:","code":"data.frame(ID=1, TIME=c(0.0,3), DV=c(NA,60.0), AMT=c(1000,0), EVID=c(101,0)) #> ID TIME DV AMT EVID #> 1 1 0 NA 1000 101 #> 2 1 3 60 0 0"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"required-fields-and-data","dir":"Articles","previous_headings":"Structure","what":"Required fields and data","title":"Patient records","text":"TIME Dosing times, sampling times therapeutic drug monitoring (TDM). units depend specification population pharmacokinetics (ppk) model. AMT Amount drug administered. units depend specification ppk model. EVID Event type. Must 0 observations (concentrations TDM). DV concentrations. Must NA EVID 0. Covariates Every covariate defined prior posologyr model. column names must match covariate vector ppk model. OCC Occasions. Required models inter-occasion variability. DVID Observation type. Required models multiple endpoints. CMT Name (number) compartment dose administered, see vignette(\"route_of_administration\").","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"a-priori-dose-adjustment","dir":"Articles","previous_headings":"Common use cases","what":"A priori dose adjustment","title":"Patient records","text":"dosing: simplest patient record single line dataframe, individual patient covariates, columns (TIME, DV, AMT, EVID) set zero.","code":"data.frame(ID=1, TIME=0, DV=0, AMT=0, EVID=0, COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID COVAR1 COVAR2 #> 1 1 0 0 0 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"oral-administration-or-iv-bolus","dir":"Articles","previous_headings":"Common use cases","what":"Oral administration or IV bolus","title":"Patient records","text":"EVID = 1 instantaneous administration first compartment defined ppk model: either central compartment IV bolus, depot compartment oral administration.","code":"data.frame(ID=1, TIME=c(0.0,3), DV=c(NA,60.0), AMT=c(1000,0), EVID=c(1,0), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID COVAR1 COVAR2 #> 1 1 0 NA 1000 1 X Y #> 2 1 3 60 0 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"intermittent-infusion","dir":"Articles","previous_headings":"Common use cases","what":"Intermittent infusion","title":"Patient records","text":"EVID = 1 bolus infusion, administered first compartment defined ppk model. DUR defines duration. AMT amount administered duration DUR.","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(1000,0,0), DUR=c(0.5,NA,NA), EVID=c(1,0,0), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT DUR EVID COVAR1 COVAR2 #> 1 1 0 NA 1000 0.5 1 X Y #> 2 1 1 25.0 0 NA 0 X Y #> 3 1 14 5.5 0 NA 0 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"inter-occasion-variability","dir":"Articles","previous_headings":"Common use cases","what":"Inter-occasion variability","title":"Patient records","text":"given occasion, value OCC must repeated row. OCC must specified rows table.","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0,24.0,25.0,36.0), DV=c(NA,25.0,5.5,NA,30.0,6.0), AMT=c(1000,0,0,1000,0,0), DUR=c(0.5,NA,NA,0.5,NA,NA), EVID=c(1,0,0,1,0,0), OCC=c(1,1,1,2,2,2), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT DUR EVID OCC COVAR1 COVAR2 #> 1 1 0 NA 1000 0.5 1 1 X Y #> 2 1 1 25.0 0 NA 0 1 X Y #> 3 1 14 5.5 0 NA 0 1 X Y #> 4 1 24 NA 1000 0.5 1 2 X Y #> 5 1 25 30.0 0 NA 0 2 X Y #> 6 1 36 6.0 0 NA 0 2 X Y"},{"path":"https://levenc.github.io/posologyr/articles/patient_data_input.html","id":"multiple-endpoints","dir":"Articles","previous_headings":"Common use cases","what":"Multiple endpoints","title":"Patient records","text":"DVID used specify type observation. values DVID dataset must match names residual error models, see vignette(\"multiple_endpoints\").","code":"data.frame(ID=1, TIME=c(0.0,1.0,14.0,24.0,25.0,36.0), DV=c(NA,20.0,80,35.5,60.0,40.0), AMT=c(1000,0,0,0,0,0), EVID=c(1,0,0,0,0,0), DVID=c(\"parent\",\"parent\",\"metabolite\",\"parent\",\"metabolite\",\"metabolite\"), COVAR1=c(\"X\"), COVAR2=c(\"Y\")) #> ID TIME DV AMT EVID DVID COVAR1 COVAR2 #> 1 1 0 NA 1000 1 parent X Y #> 2 1 1 20.0 0 0 parent X Y #> 3 1 14 80.0 0 0 metabolite X Y #> 4 1 24 35.5 0 0 parent X Y #> 5 1 25 60.0 0 0 metabolite X Y #> 6 1 36 40.0 0 0 metabolite X Y"},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Population models","text":"describes structure prior population models compatible posologyr illustrates define new models published population models.","code":""},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"general-structure","dir":"Articles","previous_headings":"","what":"General structure","title":"Population models","text":"models can written model function can parsed rxode2. models written two block statements: ini({}) defining parameter values model({}) ODE-based model specification. example, gentamicin model Xuan et al. 2003 (doi:10.1016/j.ijantimicag.2003.07.010) can written : rxode2 mini-language syntax detailed rxode2 documentation.","code":"mod_gentamicin_Xuan2003 <- function() { ini({ #Fixed effects: population estimates THETA_Cl = 0.047 THETA_V = 0.28 THETA_k12 = 0.092 THETA_k21 = 0.071 #Random effects: inter-individual variability ETA_Cl ~ 0.084 ETA_V ~ 0.003 ETA_k12 ~ 0.398 ETA_k21 ~ 0.342 #Unexplained residual variability add_sd <- 0.230 prop_sd <- 0.237 }) model({ #Individual model and covariates TVl = THETA_Cl*ClCr TVV = THETA_V*WT TVk12 = THETA_k12 TVk21 = THETA_k21 Cl = TVl*exp(ETA_Cl) V = TVV*exp(ETA_V) k12 = TVk12*exp(ETA_k12) k21 = TVk21*exp(ETA_k21) #Structural model defined using ordinary differential equations (ODE) ke = Cl/V Cp = centr/V d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph #Model for unexplained residual variability Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) }"},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"individual-model-random-effects","dir":"Articles","previous_headings":"","what":"Individual model, random effects","title":"Population models","text":"Inter-individual variability can also defined symmetric matrix integrate covariance random effects. example, amikacin model Burdet et al. 2015 (doi:10.1007/s00228-014-1766-y) can written : estimates variances random effects can given different parameterizations depending authors. Standard deviation (SD): square root variance, returned Monolix Coefficient variation (CV): calculated sqrt(exp(SD^2)-1), variance can computed back log((CV^2)+1) Full covariance matrix: easiest reuse, less common literature estimates covariance (diagonal) sometimes given coefficients correlation ETAs. covariance ETA_a ETA_b can computed following product: standard_deviation(ETA_a) * standard_deviation(ETA_b) * correlation(ETA_a ETA_b).","code":"mod_amikacin_Burdet2015 <- function() { ini({ #Fixed effects: population estimates THETA_Cl=4.3 THETA_Vc=15.9 THETA_Vp=21.4 THETA_Q=12.1 #Random effects: inter-individual variability ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.1, 0.01 , 0.05 , 0.01 , 0.02 , 0.2 , -0.06 , 0.004, 0.003, 0.08) #Unexplained residual variability add_sd <- 0.2 prop_sd <- 0.1 }) model({ #Individual model and covariates TVCl = THETA_Cl*(CLCREAT4H/82)^0.7 TVVc = THETA_Vc*(TBW/78)^0.9*(PoverF/169)^0.4 TVVp = THETA_Vp TVQ = THETA_Q Cl = TVCl*exp(ETA_Cl) Vc = TVVc*exp(ETA_Vc) Vp = TVVp*exp(ETA_Vp) Q = TVQ *exp(ETA_Q) #Structural model defined using ordinary differential equations (ODE) ke = Cl/Vc k12 = Q/Vc k21 = Q/Vp Cp = centr/Vc d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph #Model for unexplained residual variability Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) }"},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"bioavailability-lag-time","dir":"Articles","previous_headings":"","what":"Bioavailability, lag-time","title":"Population models","text":"Special model event changes including bioavailability (f(depot)=1), lag time (alag(depot)=0) can used model({}) block. example, ganciclovir model Caldès et al. 2009 (doi:10.1128/aac.00085-09) can written :","code":"mod_ganciclovir_Caldes2009 <- function() { ini({ #Fixed effects: population estimates THETA_cl <- 7.49 THETA_v1 <- 31.90 THETA_cld <- 10.20 THETA_v2 <- 32.0 THETA_ka <- 0.895 THETA_baf <- 0.825 #Random effects: inter-individual variability ETA_cl ~ 0.107 ETA_v1 ~ 0.227 ETA_ka ~ 0.464 ETA_baf ~ 0.049 #Unexplained residual variability add.sd <- 0.465 prop.sd <- 0.143 }) model({ #Individual model and covariates TVcl = THETA_cl*(ClCr/57); TVv1 = THETA_v1; TVcld = THETA_cld; TVv2 = THETA_v2; TVka = THETA_ka; TVbaf = THETA_baf; cl = TVcl*exp(ETA_cl); v1 = TVv1*exp(ETA_v1); cld = TVcld; v2 = TVv2; ka = TVka*exp(ETA_ka); baf = TVbaf*exp(ETA_baf); #Structural model defined using ordinary differential equations (ODE) k10 = cl/v1; k12 = cld / v1; k21 = cld / v2; Cc = centr/v1; d/dt(depot) = -ka*depot d/dt(centr) = ka*depot - k10*centr - k12*centr + k21*periph; d/dt(periph) = k12*centr - k21*periph; d/dt(AUC) = Cc; #Special model event changes f(depot)=baf; alag(depot)=0.382; #Model for unexplained residual variability Cc ~ add(add.sd) + prop(prop.sd) + combined1() }) }"},{"path":"https://levenc.github.io/posologyr/articles/population_models.html","id":"classic-posologyr-models","dir":"Articles","previous_headings":"","what":"Classic posologyr models","title":"Population models","text":"models described rxode2 model function alone. possible define classic posologyr model, see vignette (\"classic_posologyr_models\"). Models falling category : models inter-occasion variability (IOV), sometimes called intra-individual variability models unexplained residual error model additive, proportional, combined models","code":""},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"User defined models","text":"describes structure prior models usable posologyr illustrates define new models published population pharmacokinetic (ppk) models.","code":""},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"structure","dir":"Articles","previous_headings":"","what":"Structure","title":"User defined models","text":"posologyr prior ppk model named R list: ppk_model rxode2 model implementing structural population pharmacokinetics model individual model (.e. model inter-individual variability) covariates error_model function residual error model, alternatively named list functions multiple endpoints model vignette(\"multiple_endpoints\") theta named vector population estimates fixed effects parameters (called THETAs, following NONMEM terminology) omega named square variance-covariance matrix population parameters inter-individual variability sigma estimates parameters residual error model pi_matrix Optional. named square variance-covariance matrix population parameters inter-occasion variability covariates character vector covariates model","code":""},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"definition-of-a-prior-model-through-an-example","dir":"Articles","previous_headings":"","what":"Definition of a prior model through an example","title":"User defined models","text":"model implement two-compartment ppk model vancomycin derived retrospective study cohort 1,800 patients (doi:10.1097/FTD.0000000000000490).","code":""},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"ppk_model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"ppk_model","title":"User defined models","text":"model defined rxode2::rxode() mini-language. posologyr needs structural model, defined either differential algebraic equations, individual model. concentration central compartment must named Cc. differential function d/dt(AUC) = Cc; needed optimisation function poso_dose_auc().","code":"ppk_model = rxode2::rxode({ centr(0) = 0; TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) = Cc; })"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"error_model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"error_model","title":"User defined models","text":"function residual error model, taking two arguments: simulated concentrations, vector sigma estimates parameters residual error model. Alternatively, function can take simulated concentrations, matrix sigma estimates parameters residual error model, following example: multiple endpoint models, error_model must named list function endpoint vignette(\"multiple_endpoints\").","code":"error_model <- function(f,sigma){ #additive model if sigma[2] == 0 g <- sigma[1] + sigma[2]*f #proportional model if sigma[1] == 0 return(g) } error_model <- function(f,sigma){ dv <- cbind(f,1) g <- diag(dv%*%sigma%*%t(dv)) #sigma is the square matrix of the residual return(sqrt(g)) #errors }"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"theta","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"theta","title":"User defined models","text":"estimations parameters fixed effects model (THETA), named vector. names must match names used ppk_model.","code":"theta = c(THETA_Cl=4.5, THETA_Vc=58.4, THETA_Vp=38.4, THETA_Q=6.5)"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"omega","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"omega","title":"User defined models","text":"variance-covariance matrix random effects (ETA) individual model. symmetric matrix. names must match names used ppk_model. easy way define using lotri::lotri(). estimates variances random effects can given different parameterizations depending authors. Standard deviation (SD): square root variance, returned Monolix Coefficient variation (CV): calculated sqrt(exp(SD^2)-1), standard deviation can computed back sqrt(log((CV^2)+1)) Full covariance matrix: easiest reuse, rarely seen articles case vancomycin model, estimates subject variability (BSV) given CV%. must converted variances prior inclusion omega. estimates covariance (diagonal) sometimes given coefficients correlation ETAs. covariance ETA_a ETA_b can computed following product: standard_deviation(ETA_a) * standard_deviation(ETA_b) * correlation(ETA_a ETA_b). example, covariances equal zero.","code":"omega = lotri::lotri({ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.147, 0 , 0.510 , 0 , 0 , 0.282, 0 , 0 , 0 , 0)})"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"sigma","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"sigma","title":"User defined models","text":"estimates parameters residual error model, either vector: matrix: named list, see vignette(\"multiple_endpoints\"): depending residual error model.","code":"sigma = c(additive_a = 3.4, proportional_b = 0.227) sigma = lotri::lotri({prop + add ~ c(0.227,0.0,3.4)}) sigma = list( cp=c(additive_a = 0.144, proportional_b = 0.15), pca=c(additive_a = 3.91, proportional_b = 0.0) )"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"pi_matrix","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"pi_matrix","title":"User defined models","text":"Optional: needed models inter-occasion variability (IOV). variance-covariance matrix random effects (KAPPA) IOV. omega matrix, names must match names used ppk_model. easy way define using lotri::lotri().","code":"pi_matrix = lotri::lotri({KAPPA_Cl + KAPPA_Vc ~ c(0.1934626, 0.00 , 0.05783106)})"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"covariates","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"covariates","title":"User defined models","text":"names every covariate defined ppk_model, character vector.","code":"covariates = c(\"CLCREAT\",\"WT\",\"DIAL\")"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"full-model","dir":"Articles","previous_headings":"Definition of a prior model through an example","what":"Full model","title":"User defined models","text":"posologyr model list objects. Note: model include inter-occasion variability, pi_matrix omitted.","code":"mod_vancomyin_Goti2018 <- list( ppk_model = rxode2::rxode({ centr(0) = 0; TVCl = THETA_Cl*(CLCREAT/120)^0.8*(0.7^DIAL); TVVc = THETA_Vc*(WT/70) *(0.5^DIAL); TVVp = THETA_Vp; TVQ = THETA_Q; Cl = TVCl*exp(ETA_Cl); Vc = TVVc*exp(ETA_Vc); Vp = TVVp*exp(ETA_Vp); Q = TVQ; ke = Cl/Vc; k12 = Q/Vc; k21 = Q/Vp; Cc = centr/Vc; d/dt(centr) = - ke*centr - k12*centr + k21*periph; d/dt(periph) = + k12*centr - k21*periph; d/dt(AUC) = Cc; }), error_model = function(f,sigma){ g <- sigma[1] + sigma[2]*f return(g) }, theta = c(THETA_Cl=4.5, THETA_Vc=58.4, THETA_Vp=38.4,THETA_Q=6.5), omega = lotri::lotri({ETA_Cl + ETA_Vc + ETA_Vp + ETA_Q ~ c(0.147, 0 , 0.510 , 0 , 0 , 0.282, 0 , 0 , 0 , 0)}), sigma = c(additive_a = 3.4, proportional_b = 0.227), covariates = c(\"CLCREAT\",\"WT\",\"DIAL\"))"},{"path":"https://levenc.github.io/posologyr/articles/posologyr_user_defined_models.html","id":"resulting-r-object","dir":"Articles","previous_headings":"Definition of a prior model through an example > Full model","what":"Resulting R object","title":"User defined models","text":"","code":"mod_vancomyin_Goti2018 #> $ppk_model #> rxode2 NA model named rx_bce7176cfa18100af62e71ae38d3cd48 model (✔ ready). #> $state: centr, periph, AUC #> $params: THETA_Cl, CLCREAT, DIAL, THETA_Vc, WT, THETA_Vp, THETA_Q, ETA_Cl, ETA_Vc, ETA_Vp #> $lhs: TVCl, TVVc, TVVp, TVQ, Cl, Vc, Vp, Q, ke, k12, k21, Cc #> #> $error_model #> function(f,sigma){ #> g <- sigma[1] + sigma[2]*f #> return(g) #> } #> #> $theta #> THETA_Cl THETA_Vc THETA_Vp THETA_Q #> 4.5 58.4 38.4 6.5 #> #> $omega #> ETA_Cl ETA_Vc ETA_Vp ETA_Q #> ETA_Cl 0.147 0.00 0.000 0 #> ETA_Vc 0.000 0.51 0.000 0 #> ETA_Vp 0.000 0.00 0.282 0 #> ETA_Q 0.000 0.00 0.000 0 #> #> $sigma #> additive_a proportional_b #> 3.400 0.227 #> #> $covariates #> [1] \"CLCREAT\" \"WT\" \"DIAL\""},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Route of administration","text":"Caldès 2009 ganciclovir model (https://doi.org/10.1128/aac.00085-09) capable describing pharmacokinetics either injectable ganciclovir oral valganciclovir.","code":"mod_ganciclovir_Caldes_2009 <- function() { ini({ THETA_cl <- 7.49 THETA_v1 <- 31.90 THETA_cld <- 10.20 THETA_v2 <- 32.0 THETA_ka <- 0.895 THETA_baf <- 0.825 ETA_cl ~ 0.107 ETA_v1 ~ 0.227 ETA_ka ~ 0.464 ETA_baf ~ 0.049 add.sd <- 0.465 prop.sd <- 0.143 }) model({ TVcl = THETA_cl*(ClCr/57); TVv1 = THETA_v1; TVcld = THETA_cld; TVv2 = THETA_v2; TVka = THETA_ka; TVbaf = THETA_baf; cl = TVcl*exp(ETA_cl); v1 = TVv1*exp(ETA_v1); cld = TVcld; v2 = TVv2; ka = TVka*exp(ETA_ka); baf = TVbaf*exp(ETA_baf); k10 = cl/v1; k12 = cld / v1; k21 = cld / v2; Cc = centr/v1; d/dt(depot) = -ka*depot d/dt(centr) = ka*depot - k10*centr - k12*centr + k21*periph; d/dt(periph) = k12*centr - k21*periph; d/dt(AUC) = Cc; f(depot)=baf; alag(depot)=0.382; Cc ~ add(add.sd) + prop(prop.sd) + combined1() }) }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"patient-record-with-tdm-data","dir":"Articles","previous_headings":"Intravenous ganciclovir","what":"Patient record with TDM data","title":"Route of administration","text":"describe intravenous administration, CMT column added TDM data table indicate administrations directly central compartment. Note: compute AUC last dose time last dose + 24 hours, dummy dose 0 mg added time last observation interest (.e. H144).","code":"patient <- data.frame(ID=1,TIME=c(0,121,122,126,144), DV=c(NA,10.8,5.8,3.3,NA), ADDL=c(5,0,0,0,0), II=c(24,0,0,0,0), EVID=c(1,0,0,0,1), CMT=c(\"centr\",NA,NA,NA,\"centr\"), AMT=c(250,0,0,0,0), DUR=c(0.5,NA,NA,NA,NA), ClCr=25) patient #> ID TIME DV ADDL II EVID CMT AMT DUR ClCr #> 1 1 0 NA 5 24 1 centr 250 0.5 25 #> 2 1 121 10.8 0 0 0 0 NA 25 #> 3 1 122 5.8 0 0 0 0 NA 25 #> 4 1 126 3.3 0 0 0 0 NA 25 #> 5 1 144 NA 0 0 1 centr 0 NA 25"},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"individual-pk-profile-and-auc-0-24","dir":"Articles","previous_headings":"Intravenous ganciclovir","what":"Individual PK profile and AUC 0-24","title":"Route of administration","text":"individual PK profile can estimated, plotted. difference cumulative AUC H144 H120 gives AUC 0-24 last dose. Using data.table optional, syntax convenient.","code":"map_patient <- poso_estim_map(patient,mod_ganciclovir_Caldes_2009) plot(map_patient$model,Cc) library(data.table) data.table(map_patient$model)[time==144,AUC] - data.table(map_patient$model)[time==120,AUC] #> [1] 72.19085"},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"optimal-dose-for-an-intravenous-ganciclovir-injection","dir":"Articles","previous_headings":"Intravenous ganciclovir","what":"Optimal dose for an intravenous ganciclovir injection","title":"Route of administration","text":"optimal dose achieve AUC 50 mg.h/L can determined new injection IV ganciclovir setting cmt_dose = \"centr\".","code":"poso_dose_auc(patient,mod_ganciclovir_Caldes_2009,tdm=TRUE, time_dose = 145, duration = 1, time_auc = 24, target_auc = 50, cmt_dose = \"centr\") #> $dose #> [1] 156.5335 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 50 #> #> $indiv_param #> THETA_cl THETA_v1 THETA_cld THETA_v2 THETA_ka THETA_baf add.sd prop.sd #> 1 7.49 31.9 10.2 32 0.895 0.825 0.465 0.143 #> ETA_cl ETA_v1 ETA_ka ETA_baf covar #> 1 0.05256541 -0.4773341 -3.589527e-08 -1.272466e-07 25"},{"path":"https://levenc.github.io/posologyr/articles/route_of_administration.html","id":"optimal-dose-for-an-oral-valganciclovir-administration","dir":"Articles","previous_headings":"Intravenous ganciclovir","what":"Optimal dose for an oral valganciclovir administration","title":"Route of administration","text":"optimal dose achieve AUC 50 mg.h/L can determined administration oral valganciclovir setting cmt_dose = \"depot\". Keeping default value cmt_dose, first compartment declared PK model, also work .","code":"poso_dose_auc(patient,mod_ganciclovir_Caldes_2009,tdm=TRUE, time_dose = 145, time_auc = 24, target_auc = 50, cmt_dose = \"depot\") #> $dose #> [1] 193.1298 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 50 #> #> $indiv_param #> THETA_cl THETA_v1 THETA_cld THETA_v2 THETA_ka THETA_baf add.sd prop.sd #> 1 7.49 31.9 10.2 32 0.895 0.825 0.465 0.143 #> ETA_cl ETA_v1 ETA_ka ETA_baf covar #> 1 0.0525648 -0.4773328 -1.018546e-06 2.327066e-07 25"},{"path":"https://levenc.github.io/posologyr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Cyril Leven. Author, maintainer, copyright holder. Matthew Fidler. Contributor. Emmanuelle Comets. Contributor. Audrey Lavenu. Contributor. Marc Lavielle. Contributor.","code":""},{"path":"https://levenc.github.io/posologyr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Leven C, Coste , Mané C (2022). “Free Open-Source Posologyr Software Bayesian Dose Individualization: Extensive Validation Simulated Data.” Pharmaceutics, 14(2), 442. doi:10.3390/pharmaceutics14020442, https://europepmc.org/article/pmc/8879752.","code":"@Article{posologyrpaper, title = {Free and Open-Source Posologyr Software for Bayesian Dose Individualization: An Extensive Validation on Simulated Data}, author = {Cyril Leven and Anne Coste and Camille Mané}, journal = {Pharmaceutics}, year = {2022}, volume = {14}, pages = {442}, number = {2}, doi = {10.3390/pharmaceutics14020442}, publisher = {MDPI}, url = {https://europepmc.org/article/pmc/8879752}, }"},{"path":[]},{"path":"https://levenc.github.io/posologyr/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"Personalize drug regimens using individual pharmacokinetic (PK) pharmacokinetic-pharmacodynamic (PK-PD) profiles. combining therapeutic drug monitoring (TDM) data population model, posologyr offers accurate posterior estimates helps compute optimal individualized dosing regimens. Key dosage optimization functions posologyr include: poso_dose_conc() estimates optimal dose achieve target concentration given time poso_dose_auc() estimates dose needed reach target area concentration-time curve (AUC) poso_time_cmin() estimates time required reach target trough concentration (Cmin) poso_inter_cmin() estimates optimal dosing interval consistently achieve target Cmin Individual PK profiles can estimated without TDM data: poso_estim_map() computes Maximum Posteriori Bayesian Estimates (MAP-) individual PK parameters using TDM results poso_simu_pop() samples prior distributions PK parameters posologyr leverages simulation capabilities rxode2 package.","code":""},{"path":"https://levenc.github.io/posologyr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"can install released version posologyr CRAN : can install development version posologyr GitHub :","code":"install.packages(\"posologyr\") # install.packages(\"remotes\") remotes::install_github(\"levenc/posologyr\")"},{"path":"https://levenc.github.io/posologyr/index.html","id":"bayesian-dosing-example","dir":"","previous_headings":"","what":"Bayesian dosing example","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"determine optimal dose gentamicin patient posologyr, need: prior PK model, written rxode2 mini-language example, gentamicin PK literature doi:10.1016/j.ijantimicag.2003.07.010 table patient’s TDM data, format similar data NONMEM","code":"mod_gentamicin_Xuan2003 <- function() { ini({ THETA_Cl = 0.047 THETA_V = 0.28 THETA_k12 = 0.092 THETA_k21 = 0.071 ETA_Cl ~ 0.084 ETA_V ~ 0.003 ETA_k12 ~ 0.398 ETA_k21 ~ 0.342 add_sd <- 0.230 prop_sd <- 0.237 }) model({ TVl = THETA_Cl*ClCr TVV = THETA_V*WT TVk12 = THETA_k12 TVk21 = THETA_k21 Cl = TVl*exp(ETA_Cl) V = TVV*exp(ETA_V) k12 = TVk12*exp(ETA_k12) k21 = TVk21 *exp(ETA_k21) ke = Cl/V Cp = centr/V d/dt(centr) = - ke*centr - k12*centr + k21*periph d/dt(periph) = + k12*centr - k21*periph Cp ~ add(add_sd) + prop(prop_sd) + combined1() }) } patient_data <- data.frame(ID=1, TIME=c(0.0,1.0,11.0), DV=c(NA,9,2), AMT=c(180,0,0), DUR=c(0.5,NA,NA), EVID=c(1,0,0), ClCr=38, WT=63) patient_data #> ID TIME DV AMT DUR EVID ClCr WT #> 1 1 0 NA 180 0.5 1 38 63 #> 2 1 1 9 0 NA 0 38 63 #> 3 1 11 2 0 NA 0 38 63"},{"path":"https://levenc.github.io/posologyr/index.html","id":"individual-pk-profile","dir":"","previous_headings":"Bayesian dosing example","what":"Individual PK profile","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"two elements, can estimate plot individual concentrations time.","code":"library(\"posologyr\") patient_map <- poso_estim_map(patient_data,mod_gentamicin_Xuan2003) plot(patient_map$model,Cc)"},{"path":"https://levenc.github.io/posologyr/index.html","id":"dose-optimization","dir":"","previous_headings":"Bayesian dosing example","what":"Dose optimization","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"optimize gentamicin dosage patient meet two criteria: peak concentration 12 mg/L, 30 minutes 30-minute infusion. trough concentration less 0.5 mg/L. time required reach residual concentration 0.5 mg/L can estimated follows: dose required achieve target concentration can determined infusion H48. conclusion dose 240 mg 48 h first injection appropriate meet 2 criteria. examples can found : https://levenc.github.io/posologyr/","code":"poso_time_cmin(patient_data,mod_gentamicin_Xuan2003,tdm=TRUE, target_cmin = 0.5) #> $time #> [1] 44.9 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $cmin_estimate #> [1] 0.4991313 #> #> $indiv_param #> THETA_Cl THETA_V THETA_k12 THETA_k21 add_sd prop_sd ETA_Cl ETA_V #> 3 0.047 0.28 0.092 0.071 0.23 0.237 0.03701064 0.001447308 #> ETA_k12 ETA_k21 ClCr WT #> 3 0.08904703 -0.04838898 38 63 poso_dose_conc(patient_data,mod_gentamicin_Xuan2003,tdm=TRUE, target_conc = 12,duration=0.5,time_dose = 48,time_c = 49) #> $dose #> [1] 237.5902 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 12 #> #> $indiv_param #> THETA_Cl THETA_V THETA_k12 THETA_k21 add_sd prop_sd ETA_Cl ETA_V #> 3 0.047 0.28 0.092 0.071 0.23 0.237 0.03701052 0.001447305 #> ETA_k12 ETA_k21 ClCr WT #> 3 0.08904752 -0.04838936 38 63"},{"path":"https://levenc.github.io/posologyr/index.html","id":"performance-of-the-map-be-algorithm-in-posologyr","dir":"","previous_headings":"","what":"Performance of the MAP-BE algorithm in posologyr","title":"Individual Dose Optimization using Population Pharmacokinetics","text":"posologyr showed comparable performance NONMEM MAP estimation option MAXEVAL=0: Pharmaceutics 2022, 14(2), 442; doi:10.3390/pharmaceutics14020442 Supporting data: https://github.com/levenc/posologyr-pharmaceutics","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":null,"dir":"Reference","previous_headings":"","what":"Residual error model combined 1 — error_model_comb1","title":"Residual error model combined 1 — error_model_comb1","text":"Residual error model combined 1. Constant error model proportional coefficient provided. Proportional error model constant (additive) error coefficient provided.","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Residual error model combined 1 — error_model_comb1","text":"","code":"error_model_comb1(f, sigma)"},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Residual error model combined 1 — error_model_comb1","text":"f Numeric vector, output pharmacokinetic model sigma Numeric vector coefficients residual error model","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Residual error model combined 1 — error_model_comb1","text":"Numeric vector, residual error","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb1.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Residual error model combined 1 — error_model_comb1","text":"Implements following function: g <- sigma[1] + sigma[2]*f","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":null,"dir":"Reference","previous_headings":"","what":"Residual error model combined 2 — error_model_comb2","title":"Residual error model combined 2 — error_model_comb2","text":"Residual error model combined 2.","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Residual error model combined 2 — error_model_comb2","text":"","code":"error_model_comb2(f, sigma)"},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Residual error model combined 2 — error_model_comb2","text":"f Numeric vector, output pharmacokinetic model sigma Numeric vector coefficients residual error model","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Residual error model combined 2 — error_model_comb2","text":"Numeric vector, residual error","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_comb2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Residual error model combined 2 — error_model_comb2","text":"Implements following function: g <- sqrt(sigma[1]^2 + sigma[2]^2*f^2)","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_mixednm.html","id":null,"dir":"Reference","previous_headings":"","what":"Residual error model mixed (idem NONMEM) — error_model_mixednm","title":"Residual error model mixed (idem NONMEM) — error_model_mixednm","text":"Mixed residual error model, similar NONMEM implementation.","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_mixednm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Residual error model mixed (idem NONMEM) — error_model_mixednm","text":"","code":"error_model_mixednm(f, sigma)"},{"path":"https://levenc.github.io/posologyr/reference/error_model_mixednm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Residual error model mixed (idem NONMEM) — error_model_mixednm","text":"f Numeric vector, output pharmacokinetic model sigma Matrix coefficients residual error model","code":""},{"path":"https://levenc.github.io/posologyr/reference/error_model_mixednm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Residual error model mixed (idem NONMEM) — error_model_mixednm","text":"Numeric vector, residual error","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the dose needed to reach a target area under the concentration-time curve (AUC) — poso_dose_auc","title":"Estimate the dose needed to reach a target area under the concentration-time curve (AUC) — poso_dose_auc","text":"estimates dose needed reach target area concentration-time curve (AUC) given population pharmacokinetic model, set individual parameters, target AUC.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the dose needed to reach a target area under the concentration-time curve (AUC) — poso_dose_auc","text":"","code":"poso_dose_auc( dat = NULL, prior_model = NULL, tdm = FALSE, time_auc, time_dose = NULL, cmt_dose = 1, target_auc, estim_method = \"map\", nocb = FALSE, p = NULL, greater_than = TRUE, starting_time = 0, interdose_interval = NULL, add_dose = NULL, duration = 0, starting_dose = 100, indiv_param = NULL )"},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the dose needed to reach a target area under the concentration-time curve (AUC) — poso_dose_auc","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. tdm boolean. TRUE: estimates optimal dose selected target auc selected duration following events dat, using Maximum Posteriori estimation. Setting tdm TRUE causes following occur: time_dose argument required used starting point AUC calculation instead starting_time; arguments estim_method, p, greater_than, interdose_interval, add_dose, indiv_param starting_time ignored. time_auc Numeric. duration. target AUC computed starting_time starting_time + time_auc. tdm set TRUE target AUC computed time_dose time_dose + time_auc instead. time_dose Numeric. Time dose given. used mandatory, tdm set TRUE. cmt_dose Character numeric. compartment dose administered. Must match one compartments prior model. Defaults 1. target_auc Numeric. target AUC. estim_method character string. estimation method used individual parameters. default method \"map\" Maximum Posteriori estimation, method \"prior\" simulates prior population model, \"sir\" uses Sequential Importance Resampling algorithm estimate posteriori distribution individual parameters. argument ignored indiv_param provided, tdm set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. p Numeric. proportion distribution AUC consider optimization. Mandatory estim_method=sir. argument ignored tdm set TRUE. greater_than boolean. TRUE: targets dose leading proportion p AUCs greater target_auc. Respectively, lower FALSE. argument ignored tdm set TRUE. starting_time Numeric. First point time AUC, multiple dose regimen. default zero. argument ignored tdm set TRUE, time_dose used starting point instead. interdose_interval Numeric. Time interdose interval multiple dose regimen. Must provided add_dose used. argument ignored tdm set TRUE. add_dose Numeric. Additional doses administered inter-dose interval first dose. Optional. argument ignored tdm set TRUE. duration Numeric. Duration infusion, zero-order administrations. starting_dose Numeric. Starting dose optimization algorithm. indiv_param Optional. set individual parameters : THETA, estimates ETA, covariates. argument ignored tdm set TRUE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the dose needed to reach a target area under the concentration-time curve (AUC) — poso_dose_auc","text":"list containing following components: dose Numeric. optimal dose selected target AUC. type_of_estimate Character string. type estimate individual parameters. Either point estimate, distribution. auc_estimate vector numeric estimates AUC. Either single value (point estimate ETA), distribution. indiv_param data.frame. set individual parameters used determination optimal dose : THETA, estimates ETA, covariates","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_auc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the dose needed to reach a target area under the concentration-time curve (AUC) — poso_dose_auc","text":"","code":"rxode2::setRxThreads(2L) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the optimal dose to reach an AUC(0-12h) of 45 h.mg/l poso_dose_auc(dat=df_patient01,prior_model=mod_run001, time_auc=12,target_auc=45) #> #> #> #> #> $dose #> [1] 396.0027 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $auc_estimate #> [1] 45 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 1 4 70 1 0.2236068 0.6018995 -0.4291782 0.1278321 #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the optimal dose to achieve a target concentration at any given time — poso_dose_conc","title":"Estimate the optimal dose to achieve a target concentration at any given time — poso_dose_conc","text":"Estimates optimal dose achieve target concentration given time given population pharmacokinetic model, set individual parameters, selected point time, target concentration.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the optimal dose to achieve a target concentration at any given time — poso_dose_conc","text":"","code":"poso_dose_conc( dat = NULL, prior_model = NULL, tdm = FALSE, time_c, time_dose = NULL, target_conc, cmt_dose = 1, endpoint = \"Cc\", estim_method = \"map\", nocb = FALSE, p = NULL, greater_than = TRUE, starting_dose = 100, interdose_interval = NULL, add_dose = NULL, duration = 0, indiv_param = NULL )"},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the optimal dose to achieve a target concentration at any given time — poso_dose_conc","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. tdm boolean. TRUE: estimates optimal dose selected target concentration selected point time following events dat, using Maximum Posteriori estimation. Setting tdm TRUE causes following occur: arguments estim_method, p, greater_than, interdose_interval, add_dose, indiv_param starting_time ignored. time_c Numeric. Point time dose optimized. time_dose Numeric. Time dose given. target_conc Numeric. Target concentration. cmt_dose Character numeric. compartment dose administered. Must match one compartments prior model. Defaults 1. endpoint Character. endpoint prior model optimised . default \"Cc\", central concentration. estim_method character string. estimation method used individual parameters. default method \"map\" Maximum Posteriori estimation, method \"prior\" simulates prior population model, \"sir\" uses Sequential Importance Resampling algorithm estimate posteriori distribution individual parameters. argument ignored indiv_param provided tdm set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. p Numeric. proportion distribution concentrations consider optimization. Mandatory estim_method=sir. argument ignored tdm set TRUE. greater_than boolean. TRUE: targets dose leading proportion p concentrations greater target_conc. Respectively, lower FALSE. argument ignored tdm set TRUE. starting_dose Numeric. Starting dose optimization algorithm. interdose_interval Numeric. Time interdose interval multiple dose regimen. Must provided add_dose used. argument ignored tdm set TRUE. add_dose Numeric. Additional doses administered inter-dose interval first dose. Optional. argument ignored tdm set TRUE. duration Numeric. Duration infusion, zero-order administrations. indiv_param Optional. set individual parameters : THETA, estimates ETA, covariates. argument ignored tdm set TRUE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the optimal dose to achieve a target concentration at any given time — poso_dose_conc","text":"list containing following components: dose Numeric. optimal dose selected target concentration. type_of_estimate Character string. type estimate individual parameters. Either point estimate, distribution. conc_estimate vector numeric estimates conc. Either single value (point estimate ETA), distribution. indiv_param data.frame. set individual parameters used determination optimal dose : THETA, estimates ETA, covariates","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_dose_conc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the optimal dose to achieve a target concentration at any given time — poso_dose_conc","text":"","code":"rxode2::setRxThreads(2L) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the optimal dose to reach a concentration of 80 mg/l # one hour after starting the 30-minutes infusion poso_dose_conc(dat=df_patient01,prior_model=mod_run001, time_c=1,duration=0.5,target_conc=80) #> #> #> #> #> $dose #> [1] 6886.024 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 80 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 1 4 70 1 0.2236068 0.6019041 -0.4291723 0.1278484 #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"Estimates Maximum Posteriori (MAP) individual parameters, also known Empirical Bayes Estimates (EBE).","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"","code":"poso_estim_map( dat = NULL, prior_model = NULL, return_model = TRUE, return_ofv = FALSE, nocb = FALSE )"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. return_model boolean. Returns rxode2 model using estimated ETAs set TRUE. return_ofv boolean. Returns Objective Function Value (OFV) set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"named list consisting one following elements depending input parameters function: $eta named vector MAP estimates individual values ETA, $model rxode2 model using estimated ETAs, $event data.table used solve returned rxode2 model.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the Maximum A Posteriori individual parameters — poso_estim_map","text":"","code":"rxode2::setRxThreads(1) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the Maximum A Posteriori individual parameters poso_estim_map(dat=df_patient01,prior_model=mod_run001) #> #> #> #> #> $eta #> ETA_Cl ETA_Vc ETA_Ka #> 0.6019038 -0.4291730 0.1278482 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 4.0000000 70.0000000 1.0000000 0.2236068 0.6019038 -0.4291730 0.1278482 #> ── Initial Conditions ($inits): ── #> depot centr AUC #> 0 0 0 #> ── First part of data (object): ── #> # A tibble: 151 × 13 #> time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot centr #> #> 1 0 4 70 1 7.30 45.6 1.14 0.160 0 0 0 0 #> 2 0.1 4 70 1 7.30 45.6 1.14 0.160 0.478 0.478 378. 21.8 #> 3 0.2 4 70 1 7.30 45.6 1.14 0.160 1.83 1.83 716. 83.5 #> 4 0.3 4 70 1 7.30 45.6 1.14 0.160 3.95 3.95 1017. 180. #> 5 0.4 4 70 1 7.30 45.6 1.14 0.160 6.75 6.75 1286. 307. #> 6 0.5 4 70 1 7.30 45.6 1.14 0.160 10.1 10.1 1526. 461. #> # ℹ 145 more rows #> # ℹ 1 more variable: AUC #> #> $event #> id time amt evid dur #> #> 1: 1 0.0 NA 0 NA #> 2: 1 0.0 2000 1 0.5 #> 3: 1 0.1 NA 0 NA #> 4: 1 0.2 NA 0 NA #> 5: 1 0.3 NA 0 NA #> --- #> 148: 1 14.6 NA 0 NA #> 149: 1 14.7 NA 0 NA #> 150: 1 14.8 NA 0 NA #> 151: 1 14.9 NA 0 NA #> 152: 1 15.0 NA 0 NA #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"Estimates posterior distribution individual parameters Markov Chain Monte Carlo (using Metropolis-Hastings algorithm)","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"","code":"poso_estim_mcmc( dat = NULL, prior_model = NULL, return_model = TRUE, burn_in = 50, n_iter = 1000, n_chains = 4, nocb = FALSE, control = list(n_kernel = c(2, 2, 2), stepsize_rw = 0.4, proba_mcmc = 0.3, nb_max = 3) )"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. return_model boolean. Returns rxode2 model using estimated ETAs set TRUE. burn_in Number burn-iterations Metropolis-Hastings algorithm. n_iter Total number iterations (following burn-iterations) Markov chain Metropolis-Hastings algorithm. n_chains Number Markov chains nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. control list parameters controlling Metropolis-Hastings algorithm.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"return_model set FALSE, list one element: dataframe $eta ETAs posterior distribution, estimated Markov Chain Monte Carlo. return_model set TRUE, list dataframe posterior distribution ETA, rxode2 model using estimated distributions ETAs.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"Comets E, Lavenu , Lavielle M. Parameter estimation nonlinear mixed effect models using saemix, R implementation SAEM algorithm. Journal Statistical Software 80, 3 (2017), 1-41.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"Emmanuelle Comets, Audrey Lavenu, Marc Lavielle, Cyril Leven","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_mcmc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the posterior distribution of individual parameters by MCMC — poso_estim_mcmc","text":"","code":"# model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the posterior distribution of population parameters poso_estim_mcmc(dat=df_patient01,prior_model=mod_run001, n_iter=50,n_chains=2) #> #> #> #> #> $eta #> ETA_Cl ETA_Vc ETA_Ka #> 1 0.40129734 -0.221078172 0.930425874 #> 2 0.46219626 -0.408861774 0.919479583 #> 3 0.46733199 -0.303257501 0.231586070 #> 4 0.70605689 -0.389072743 0.231586070 #> 5 0.71226862 -0.460682597 0.220690179 #> 6 0.45848168 -0.156826054 0.655923830 #> 7 0.71578116 -0.356073917 0.443066290 #> 8 0.39429314 -0.250227766 0.029447638 #> 9 0.79934008 -0.300123505 0.029447638 #> 10 0.64891523 -0.602467643 -0.257596645 #> 11 0.68534557 -0.393584606 0.471011853 #> 12 0.41497705 -0.469426296 0.200708751 #> 13 -0.28560298 -0.336731063 0.574758130 #> 14 0.69972327 -0.384404332 -0.094838457 #> 15 0.56697115 -0.427648209 -0.154894296 #> 16 0.52583412 -0.193851708 0.029564358 #> 17 0.73647568 -0.145748104 0.240492264 #> 18 0.72223572 -0.174057317 0.765403502 #> 19 0.61003356 -0.349027845 0.290769918 #> 20 0.69904470 -0.047834356 0.422258849 #> 21 0.43859699 -0.612412417 -0.098503394 #> 22 0.69096316 -0.051944909 0.914823122 #> 23 0.54729672 0.005972018 0.337291445 #> 24 0.27761493 -0.237833012 0.271761486 #> 25 0.64326906 0.011240352 0.623424475 #> 26 0.61126409 -0.364932526 -0.290915542 #> 27 0.36850878 -0.351410700 0.388243848 #> 28 0.27661006 -0.581498663 -0.230915305 #> 29 -0.23732985 -0.526465862 0.407033222 #> 30 0.19616325 -0.645638552 -0.494479393 #> 31 0.47330453 -0.034944362 0.470257171 #> 32 0.33639400 -0.515573239 -0.050276895 #> 33 0.78830319 -0.387354276 -0.031447965 #> 34 0.48064119 -0.343826881 0.244052299 #> 35 0.60189998 0.034441740 0.469481783 #> 36 0.77837261 -0.215748962 0.185718893 #> 37 0.75914818 -0.176417195 0.302207225 #> 38 0.68090244 -0.346820687 0.036191074 #> 39 0.54490321 -0.629963624 0.473465262 #> 40 0.49828937 -0.283363262 0.356249587 #> 41 0.54257518 -0.494014971 0.374892911 #> 42 0.62410466 -0.260718197 0.409061732 #> 43 0.15855684 -0.878222982 -0.131889899 #> 44 0.75140183 -0.141857343 0.326987451 #> 45 0.07179731 -0.032165060 0.268610671 #> 46 0.41210387 -0.258656564 0.462389655 #> 47 0.74462060 -0.382517639 0.673070802 #> 48 0.78287745 -0.073199344 0.521618599 #> 49 0.73952962 0.231836592 0.907839064 #> 50 0.53905726 -0.042012025 0.483275077 #> 51 0.00000000 0.000000000 0.000000000 #> 52 0.42534184 -0.403708105 1.056572451 #> 53 0.55618191 -0.264477715 0.046032939 #> 54 0.45520633 -0.679464662 -0.016242431 #> 55 0.44009565 -0.409873762 0.340896578 #> 56 0.57429692 -0.387726602 0.613547280 #> 57 0.54488941 -0.287829000 0.140149483 #> 58 0.48402318 -0.798975605 0.161344579 #> 59 0.56660040 -0.479785996 0.138614462 #> 60 0.61758410 -0.297867848 0.278458135 #> 61 0.73780864 0.023043168 0.551507628 #> 62 0.68002525 -0.319894513 0.234239231 #> 63 0.89503107 -0.037166313 0.600292939 #> 64 0.78780453 -0.263742002 0.175122402 #> 65 0.51360658 0.052946634 0.892954576 #> 66 0.64420451 -0.318996298 0.650988522 #> 67 0.68813422 -0.251065357 0.415733557 #> 68 0.78325406 0.094584973 0.439275927 #> 69 0.48416155 -0.480703520 0.124244451 #> 70 0.48645250 -0.663751410 0.007279203 #> 71 0.42371624 -0.511424673 0.239185177 #> 72 0.79998492 -0.327110133 -0.287008745 #> 73 0.55606168 -0.300343887 -0.103813643 #> 74 -0.18397797 -0.957175830 0.033660836 #> 75 0.33043554 -0.828096146 -0.054257139 #> 76 0.18819311 -0.839629729 0.143333722 #> 77 0.08262417 -0.414383051 -0.225163689 #> 78 0.37230513 -0.375817501 0.666112298 #> 79 0.51699274 -0.934285571 -0.299695700 #> 80 0.08783468 -0.800477076 -0.147109306 #> 81 0.68133590 -0.368815872 0.040840687 #> 82 0.65031284 -0.323466120 0.398707403 #> 83 0.52147855 -0.586734782 -0.127577976 #> 84 0.71718247 -0.171249178 0.372917693 #> 85 0.52524631 -0.377795316 0.640937425 #> 86 0.80589852 0.156365752 0.993932092 #> 87 0.43878864 -0.746336825 0.356184103 #> 88 0.13803478 -0.812773685 0.083051161 #> 89 0.49241332 -0.249973773 0.507466133 #> 90 0.81523875 -0.116686814 0.532386442 #> 91 0.28613945 -0.434134521 -0.055910865 #> 92 0.16400899 -0.611578714 -0.265540778 #> 93 0.49782289 -0.500626081 0.300302428 #> 94 0.69449874 -0.069173401 0.542000876 #> 95 0.44901310 -0.630662806 -0.542320029 #> 96 0.39487244 0.142613375 1.402640547 #> 97 0.64429477 -0.461460431 0.136638918 #> 98 0.57768550 -0.319792195 0.097921632 #> 99 0.56412639 -0.496782084 -0.041628981 #> 100 0.32575969 -0.106694594 0.762696118 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> # A tibble: 100 × 8 #> sim.id THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> #> 1 1 4 70 1 0.224 0.401 -0.221 0.930 #> 2 2 4 70 1 0.224 0.462 -0.409 0.919 #> 3 3 4 70 1 0.224 0.467 -0.303 0.232 #> 4 4 4 70 1 0.224 0.706 -0.389 0.232 #> 5 5 4 70 1 0.224 0.712 -0.461 0.221 #> 6 6 4 70 1 0.224 0.458 -0.157 0.656 #> 7 7 4 70 1 0.224 0.716 -0.356 0.443 #> 8 8 4 70 1 0.224 0.394 -0.250 0.0294 #> 9 9 4 70 1 0.224 0.799 -0.300 0.0294 #> 10 10 4 70 1 0.224 0.649 -0.602 -0.258 #> # ℹ 90 more rows #> ── Initial Conditions ($inits): ── #> depot centr AUC #> 0 0 0 #> #> Simulation without uncertainty in parameters, omega, or sigma matricies #> #> ── First part of data (object): ── #> # A tibble: 200 × 14 #> sim.id time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot #> #> 1 1 1 4 70 1 5.98 56.1 2.54 0.106 28.4 28.4 3.19e+2 #> 2 1 14 4 70 1 5.98 56.1 2.54 0.106 8.61 8.61 7.99e-9 #> 3 2 1 4 70 1 6.35 46.5 2.51 0.137 33.7 33.7 3.25e+2 #> 4 2 14 4 70 1 6.35 46.5 2.51 0.137 6.96 6.96 -2.81e-9 #> 5 3 1 4 70 1 6.38 51.7 1.26 0.123 22.2 22.2 7.90e+2 #> 6 3 14 4 70 1 6.38 51.7 1.26 0.123 7.85 7.85 6.03e-5 #> # ℹ 194 more rows #> # ℹ 2 more variables: centr , AUC #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"Estimates posterior distribution individual parameters Sequential Importance Resampling (SIR)","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"","code":"poso_estim_sir( dat = NULL, prior_model = NULL, n_sample = 10000, n_resample = 1000, return_model = TRUE, nocb = FALSE )"},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. n_sample Number samples S-step n_resample Number samples R-step return_model boolean. Returns rxode2 model using estimated ETAs set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"return_model set FALSE, list one element: dataframe $eta ETAs posterior distribution, estimated Sequential Importance Resampling. return_model set TRUE, list dataframe posterior distribution ETA, rxode2 model using estimated distributions ETAs.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_estim_sir.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the posterior distribution of individual parameters by SIR — poso_estim_sir","text":"","code":"# model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the posterior distribution of population parameters poso_estim_sir(dat=df_patient01,prior_model=mod_run001, n_sample=1e3,n_resample=1e2) #> #> #> #> #> $eta #> ETA_Cl ETA_Vc ETA_Ka #> 1 0.6504014 -0.46513521 0.43653693 #> 2 0.7998906 -0.03341945 0.16662057 #> 3 0.5739246 -0.05601440 0.71549851 #> 4 0.7089199 -0.17563653 0.37654151 #> 5 0.6224641 -0.44103680 0.11062341 #> 6 0.5756166 -0.54744862 -0.11639086 #> 7 0.2097388 -0.80535811 -0.39535473 #> 8 0.4410245 -0.51368224 0.18837049 #> 9 0.8041649 -0.20072306 0.23829165 #> 10 0.3270809 -0.20504934 0.30219971 #> 11 0.6224641 -0.44103680 0.11062341 #> 12 0.6901039 -0.30108197 -0.14402225 #> 13 0.5756166 -0.54744862 -0.11639086 #> 14 0.6224641 -0.44103680 0.11062341 #> 15 0.7089199 -0.17563653 0.37654151 #> 16 0.7740971 -0.30891172 0.57370521 #> 17 0.6504014 -0.46513521 0.43653693 #> 18 0.6280538 -0.23392662 0.44682453 #> 19 0.7089199 -0.17563653 0.37654151 #> 20 0.3976482 -0.64529135 0.23007851 #> 21 0.3425794 -0.70136613 0.12968425 #> 22 0.5716248 -0.36818884 0.36830570 #> 23 0.2097388 -0.80535811 -0.39535473 #> 24 0.8530497 -0.23492316 0.25581125 #> 25 0.6354166 -0.31357126 0.73866202 #> 26 0.6280538 -0.23392662 0.44682453 #> 27 0.5756166 -0.54744862 -0.11639086 #> 28 0.8530497 -0.23492316 0.25581125 #> 29 0.6354166 -0.31357126 0.73866202 #> 30 0.5480420 -0.78238693 -0.54016365 #> 31 0.6504014 -0.46513521 0.43653693 #> 32 0.6956159 -0.25114851 0.92671472 #> 33 0.3653215 -0.46129773 0.18425818 #> 34 0.4621170 -0.71068616 0.26608879 #> 35 0.2319779 -0.86032500 -0.48170475 #> 36 0.6956159 -0.25114851 0.92671472 #> 37 0.3313779 -0.54665431 0.48542548 #> 38 0.7089199 -0.17563653 0.37654151 #> 39 0.6947877 -0.46349506 0.19509695 #> 40 0.4179024 -0.58931306 0.22519506 #> 41 0.6224641 -0.44103680 0.11062341 #> 42 0.5480420 -0.78238693 -0.54016365 #> 43 0.3653215 -0.46129773 0.18425818 #> 44 0.4796500 -0.65544436 -0.11063743 #> 45 0.4737102 -0.05879126 0.68993753 #> 46 0.6224641 -0.44103680 0.11062341 #> 47 0.8041649 -0.20072306 0.23829165 #> 48 0.6441458 -0.17385456 0.07400396 #> 49 0.5480420 -0.78238693 -0.54016365 #> 50 0.5480420 -0.78238693 -0.54016365 #> 51 0.7089199 -0.17563653 0.37654151 #> 52 0.3769539 -0.82826593 0.23448758 #> 53 0.6834596 -0.07578277 0.01909532 #> 54 0.2527094 -0.21569803 0.25635943 #> 55 0.6431052 -0.37166373 -0.12400846 #> 56 0.4410245 -0.51368224 0.18837049 #> 57 0.7740971 -0.30891172 0.57370521 #> 58 0.2319779 -0.86032500 -0.48170475 #> 59 0.5716248 -0.36818884 0.36830570 #> 60 0.6280538 -0.23392662 0.44682453 #> 61 0.5756166 -0.54744862 -0.11639086 #> 62 0.5716248 -0.36818884 0.36830570 #> 63 0.6014266 -0.46330347 0.48532615 #> 64 0.4621170 -0.71068616 0.26608879 #> 65 0.2708922 -0.52232311 -0.08780402 #> 66 0.5739246 -0.05601440 0.71549851 #> 67 0.5716248 -0.36818884 0.36830570 #> 68 0.3946202 -0.37801414 0.10956928 #> 69 0.6631807 0.37417320 1.32753128 #> 70 0.6224641 -0.44103680 0.11062341 #> 71 0.6177660 0.34344899 0.79709830 #> 72 0.4796500 -0.65544436 -0.11063743 #> 73 0.6280538 -0.23392662 0.44682453 #> 74 0.2324490 -0.80580463 -0.28471752 #> 75 0.3270809 -0.20504934 0.30219971 #> 76 0.6224641 -0.44103680 0.11062341 #> 77 0.7089199 -0.17563653 0.37654151 #> 78 0.6224641 -0.44103680 0.11062341 #> 79 0.5716248 -0.36818884 0.36830570 #> 80 0.5716248 -0.36818884 0.36830570 #> 81 0.5756166 -0.54744862 -0.11639086 #> 82 0.3769539 -0.82826593 0.23448758 #> 83 0.6947877 -0.46349506 0.19509695 #> 84 0.6504014 -0.46513521 0.43653693 #> 85 0.5756166 -0.54744862 -0.11639086 #> 86 0.6224641 -0.44103680 0.11062341 #> 87 0.2944519 -0.31777262 0.32041506 #> 88 0.5065188 -0.43510689 0.59017798 #> 89 0.6354166 -0.31357126 0.73866202 #> 90 0.5065188 -0.43510689 0.59017798 #> 91 0.3951683 -0.42558280 0.21811956 #> 92 0.2486862 -0.80758491 -0.05621151 #> 93 0.7089199 -0.17563653 0.37654151 #> 94 0.4796500 -0.65544436 -0.11063743 #> 95 0.5065188 -0.43510689 0.59017798 #> 96 0.3946202 -0.37801414 0.10956928 #> 97 0.2196114 -0.43600196 0.46038729 #> 98 0.1867108 -0.72833532 0.32243635 #> 99 0.2496268 -0.29416330 0.40590506 #> 100 0.6014266 -0.46330347 0.48532615 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> # A tibble: 100 × 8 #> sim.id THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> #> 1 1 4 70 1 0.224 0.650 -0.465 0.437 #> 2 2 4 70 1 0.224 0.800 -0.0334 0.167 #> 3 3 4 70 1 0.224 0.574 -0.0560 0.715 #> 4 4 4 70 1 0.224 0.709 -0.176 0.377 #> 5 5 4 70 1 0.224 0.622 -0.441 0.111 #> 6 6 4 70 1 0.224 0.576 -0.547 -0.116 #> 7 7 4 70 1 0.224 0.210 -0.805 -0.395 #> 8 8 4 70 1 0.224 0.441 -0.514 0.188 #> 9 9 4 70 1 0.224 0.804 -0.201 0.238 #> 10 10 4 70 1 0.224 0.327 -0.205 0.302 #> # ℹ 90 more rows #> ── Initial Conditions ($inits): ── #> depot centr AUC #> 0 0 0 #> #> Simulation without uncertainty in parameters, omega, or sigma matricies #> #> ── First part of data (object): ── #> # A tibble: 200 × 14 #> sim.id time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot #> #> 1 1 1 4 70 1 7.67 44.0 1.55 0.174 28.5 28.5 6.42e+2 #> 2 1 14 4 70 1 7.67 44.0 1.55 0.174 4.66 4.66 1.18e-6 #> 3 2 1 4 70 1 8.90 67.7 1.18 0.131 16.2 16.2 8.37e+2 #> 4 2 14 4 70 1 8.90 67.7 1.18 0.131 5.45 5.45 1.79e-4 #> 5 3 1 4 70 1 7.10 66.2 2.05 0.107 22.2 22.2 4.50e+2 #> 6 3 14 4 70 1 7.10 66.2 2.05 0.107 7.30 7.30 1.20e-9 #> # ℹ 194 more rows #> # ℹ 2 more variables: centr , AUC #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the optimal dosing interval to consistently achieve a target trough concentration (Cmin) — poso_inter_cmin","title":"Estimate the optimal dosing interval to consistently achieve a target trough concentration (Cmin) — poso_inter_cmin","text":"Estimates optimal dosing interval consistently achieve target Cmin, given dose, population pharmacokinetic model, set individual parameters, target concentration.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the optimal dosing interval to consistently achieve a target trough concentration (Cmin) — poso_inter_cmin","text":"","code":"poso_inter_cmin( dat = NULL, prior_model = NULL, dose, target_cmin, cmt_dose = 1, endpoint = \"Cc\", estim_method = \"map\", nocb = FALSE, p = NULL, greater_than = TRUE, starting_interval = 12, add_dose = 10, duration = 0, indiv_param = NULL )"},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the optimal dosing interval to consistently achieve a target trough concentration (Cmin) — poso_inter_cmin","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. dose Numeric. dose given. target_cmin Numeric. Target trough concentration (Cmin). cmt_dose Character numeric. compartment dose administered. Must match one compartments prior model. Defaults 1. endpoint Character. endpoint prior model optimised . default \"Cc\", central concentration. estim_method character string. estimation method used individual parameters. default method \"map\" Maximum Posteriori estimation, method \"prior\" simulates prior population model, \"sir\" uses Sequential Importance Resampling algorithm estimate posteriori distribution individual parameters. argument ignored indiv_param provided. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. p Numeric. proportion distribution concentrations consider optimization. Mandatory estim_method=sir. greater_than boolean. TRUE: targets dose leading proportion p concentrations greater target_conc. Respectively, lower FALSE. starting_interval Numeric. Starting inter-dose interval optimization algorithm. add_dose Numeric. Additional doses administered inter-dose interval first dose. duration Numeric. Duration infusion, zero-order administrations. indiv_param Optional. set individual parameters : THETA, estimates ETA, covariates.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the optimal dosing interval to consistently achieve a target trough concentration (Cmin) — poso_inter_cmin","text":"list containing following components: interval Numeric. inter-dose interval reach target trough concentration dosing multiple dose regimen. type_of_estimate Character string. type estimate individual parameters. Either point estimate, distribution. conc_estimate vector numeric estimates conc. Either single value (point estimate ETA), distribution. indiv_param data.frame. set individual parameters used determination optimal dose : THETA, estimates ETA, covariates","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_inter_cmin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the optimal dosing interval to consistently achieve a target trough concentration (Cmin) — poso_inter_cmin","text":"","code":"rxode2::setRxThreads(2L) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the optimal interval to reach a cmin of of 2.5 mg/l # before each administration poso_inter_cmin(dat=df_patient01,prior_model=mod_run001, dose=1500,duration=0.5,target_cmin=2.5) #> #> #> #> #> $interval #> [1] 17.76029 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $conc_estimate #> [1] 2.500425 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 1 4 70 1 0.2236068 0.6019038 -0.429173 0.1278482 #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the prior distribution of population parameters — poso_simu_pop","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"Estimates prior distribution population parameters Monte Carlo simulations","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"","code":"poso_simu_pop( dat = NULL, prior_model = NULL, n_simul = 1000, return_model = TRUE )"},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. n_simul integer, number simulations run. n_simul =0, ETAs set 0. return_model boolean. Returns rxode2 model using simulated ETAs set TRUE.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"return_model set FALSE, list one element: dataframe $eta individual values ETA. return_model set TRUE, list dataframe individual values ETA, $model rxode2 model using estimated ETAs, $event data.table used solve returned rxode2 model.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_simu_pop.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the prior distribution of population parameters — poso_simu_pop","text":"","code":"# model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # estimate the prior distribution of population parameters poso_simu_pop(dat=df_patient01,prior_model=mod_run001,n_simul=100) #> #> #> #> #> $eta #> ETA_Cl ETA_Vc ETA_Ka #> 1 -0.626118495 0.114181258 -1.089977423 #> 2 -0.002491555 0.277966827 0.513585283 #> 3 -0.814741627 -0.110607238 -0.109209384 #> 4 -0.126429720 -0.247621892 0.281289321 #> 5 0.923507208 -0.729400635 0.229164299 #> 6 -0.833164068 -0.233451094 -0.023524289 #> 7 0.242835347 -0.408786690 0.209365022 #> 8 0.162316736 -0.583409609 0.329943601 #> 9 0.844565080 -0.043578776 -0.418523660 #> 10 -0.007133196 -0.369751261 -0.676365686 #> 11 0.418307135 0.078928106 0.108979453 #> 12 0.726073134 0.050104954 -0.059925286 #> 13 -0.854217084 -0.124878691 -0.140177303 #> 14 0.477314594 0.031320537 -0.285824640 #> 15 -0.022344982 -0.112466815 0.198919317 #> 16 1.232260201 0.020809466 0.258359350 #> 17 0.052858355 -0.854947394 0.385536795 #> 18 -0.108778777 -0.092164995 0.008576480 #> 19 0.013219971 0.245890352 -1.017015082 #> 20 1.199676043 -0.161543056 0.095415592 #> 21 0.480462085 -0.297436507 0.498174667 #> 22 -0.109968218 -0.526622321 -0.436413663 #> 23 0.476308114 0.058884898 0.218521447 #> 24 -0.760017399 -0.657733272 0.127075897 #> 25 0.598067870 0.105853796 0.589558724 #> 26 0.234299580 0.271345975 -0.049164727 #> 27 0.077002004 -0.040395591 0.860592505 #> 28 0.580658894 0.334869635 0.248751082 #> 29 -0.245188102 0.496646302 -1.168271430 #> 30 -0.069628373 0.194041413 -0.170813730 #> 31 0.189702450 0.475433666 0.468998541 #> 32 -0.017040133 0.217412406 0.748135847 #> 33 -0.158475130 0.423219641 0.588902649 #> 34 -0.132661452 -0.173167175 -0.351256162 #> 35 -0.472587094 -0.355776943 -0.785430249 #> 36 -0.308817936 -0.249787573 -0.240003136 #> 37 0.101574342 0.437578343 -0.093415162 #> 38 -0.625835383 0.115621390 -0.197578722 #> 39 0.254285588 0.951156441 0.190002471 #> 40 -0.753233600 0.111535869 0.479787852 #> 41 0.912033660 0.201001840 0.622438164 #> 42 0.190766359 0.048113024 0.009970508 #> 43 0.269943050 -0.117460907 -0.236246880 #> 44 0.085931834 -0.512596075 0.378425286 #> 45 0.036546129 -0.583666071 -0.422577520 #> 46 0.203187738 -0.382458185 -0.128303442 #> 47 0.400239006 0.030099460 -0.072751070 #> 48 -0.369984355 0.839198826 0.342762477 #> 49 0.438249957 0.591118430 -0.500749906 #> 50 0.230136035 -0.674889964 0.685462828 #> 51 0.191920539 0.054606307 -0.508934617 #> 52 -0.249551952 0.470709543 0.303069339 #> 53 0.017217521 -0.159378512 0.350098525 #> 54 0.359743811 -0.849733032 0.418495455 #> 55 -0.138212034 0.117646994 -0.800777022 #> 56 -0.352520072 -0.506702694 0.162630373 #> 57 -0.127852962 0.231508675 -0.046022156 #> 58 -0.435617165 0.568261928 0.429711796 #> 59 0.343782648 0.463282325 -0.211928742 #> 60 -0.570347095 -0.136677720 0.989133385 #> 61 -0.465848262 -0.512741053 -0.749229147 #> 62 0.682420512 0.247839297 0.891346008 #> 63 -0.068924890 1.146838273 0.474940456 #> 64 0.511028685 0.502596010 -0.177544465 #> 65 -0.368173579 -0.258885074 0.788790589 #> 66 0.059475896 0.168375618 0.509245544 #> 67 0.555109723 0.273735392 -0.192024613 #> 68 0.608416801 -0.031688406 -0.121710828 #> 69 -1.094188573 0.029286516 -0.491268116 #> 70 -0.283165888 -0.922894327 1.184638417 #> 71 -0.515815439 -0.152337889 0.351672035 #> 72 -0.568190736 0.242453072 0.033588380 #> 73 0.249775243 0.185775389 -0.649488201 #> 74 0.420920174 -0.151576730 -0.033797831 #> 75 0.017979951 0.055589127 -0.446512611 #> 76 0.551588806 0.152242459 -0.211398977 #> 77 0.316964005 -0.683771124 0.106179842 #> 78 -0.587108379 0.334081340 -0.698779487 #> 79 0.031776028 -0.286008644 -0.377983025 #> 80 0.301978609 0.515805336 -0.754227850 #> 81 -0.403751120 0.589263704 0.492019811 #> 82 0.538341344 -0.640083750 0.618456538 #> 83 0.001397963 -0.034832047 0.197412704 #> 84 0.057656072 -0.371283104 -0.225213596 #> 85 -0.533812565 -0.336180890 0.651072068 #> 86 -0.370562765 0.129591078 -0.214686445 #> 87 -0.270487910 0.652981124 0.066938642 #> 88 -0.641000683 -0.004607784 -0.094914840 #> 89 -0.405327650 -0.940111168 0.846736541 #> 90 -0.432959036 -0.045885473 0.107313183 #> 91 0.027234813 -0.973841605 -0.052708658 #> 92 0.050219756 0.003526815 0.839752588 #> 93 0.965425280 0.317393983 0.343005395 #> 94 -0.137836338 0.452580985 -0.411012369 #> 95 0.251951230 0.144218670 0.163981760 #> 96 0.505277641 -0.421050740 0.097419956 #> 97 0.632991621 -0.171610636 -0.077853793 #> 98 -0.099167163 -0.451474970 0.214986875 #> 99 0.717512770 -0.677539567 -0.633265146 #> 100 0.392106741 0.279120500 0.944639121 #> #> $model #> ── Solved rxode2 object ── #> ── Parameters ($params): ── #> # A tibble: 100 × 8 #> sim.id THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> #> 1 1 4 70 1 0.224 -0.626 0.114 -1.09 #> 2 2 4 70 1 0.224 -0.00249 0.278 0.514 #> 3 3 4 70 1 0.224 -0.815 -0.111 -0.109 #> 4 4 4 70 1 0.224 -0.126 -0.248 0.281 #> 5 5 4 70 1 0.224 0.924 -0.729 0.229 #> 6 6 4 70 1 0.224 -0.833 -0.233 -0.0235 #> 7 7 4 70 1 0.224 0.243 -0.409 0.209 #> 8 8 4 70 1 0.224 0.162 -0.583 0.330 #> 9 9 4 70 1 0.224 0.845 -0.0436 -0.419 #> 10 10 4 70 1 0.224 -0.00713 -0.370 -0.676 #> # ℹ 90 more rows #> ── Initial Conditions ($inits): ── #> depot centr AUC #> 0 0 0 #> #> Simulation without uncertainty in parameters, omega, or sigma matricies #> #> ── First part of data (object): ── #> # A tibble: 15,100 × 14 #> sim.id time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot #> #> 1 1 0 4 70 1 2.14 78.5 0.336 0.0273 0 0 0 #> 2 1 0.1 4 70 1 2.14 78.5 0.336 0.0273 0.0847 0.0847 393. #> 3 1 0.2 4 70 1 2.14 78.5 0.336 0.0273 0.335 0.335 774. #> 4 1 0.3 4 70 1 2.14 78.5 0.336 0.0273 0.744 0.744 1141. #> 5 1 0.4 4 70 1 2.14 78.5 0.336 0.0273 1.31 1.31 1497. #> 6 1 0.5 4 70 1 2.14 78.5 0.336 0.0273 2.02 2.02 1841. #> # ℹ 15,094 more rows #> # ℹ 2 more variables: centr , AUC #> #> $event #> ── EventTable with 152 records ── #> 1 dosing records (see $get.dosing(); add with add.dosing or et) #> 151 observation times (see $get.sampling(); add with add.sampling or et) #> ── First part of : ── #> # A tibble: 152 × 5 #> id time amt evid dur #> #> 1 1 0 NA 0:Observation NA #> 2 1 0 2000 1:Dose (Add) 0.5 #> 3 1 0.1 NA 0:Observation NA #> 4 1 0.2 NA 0:Observation NA #> 5 1 0.3 NA 0:Observation NA #> 6 1 0.4 NA 0:Observation NA #> 7 1 0.5 NA 0:Observation NA #> 8 1 0.6 NA 0:Observation NA #> 9 1 0.7 NA 0:Observation NA #> 10 1 0.8 NA 0:Observation NA #> # ℹ 142 more rows #>"},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the time required to reach a target trough concentration (Cmin) — poso_time_cmin","title":"Estimate the time required to reach a target trough concentration (Cmin) — poso_time_cmin","text":"Estimates time required reach target trough concentration (Cmin) given population pharmacokinetic model, set individual parameters, dose, target Cmin.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the time required to reach a target trough concentration (Cmin) — poso_time_cmin","text":"","code":"poso_time_cmin( dat = NULL, prior_model = NULL, tdm = FALSE, target_cmin, dose = NULL, cmt_dose = 1, endpoint = \"Cc\", estim_method = \"map\", nocb = FALSE, p = NULL, greater_than = TRUE, from = 0.2, last_time = 72, add_dose = NULL, interdose_interval = NULL, duration = 0, indiv_param = NULL )"},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the time required to reach a target trough concentration (Cmin) — poso_time_cmin","text":"dat Dataframe. individual subject dataset following structure NONMEM/rxode2 event records. prior_model posologyr prior population pharmacokinetics model, list six objects. tdm boolean. TRUE: computes predicted time reach target trough concentration (Cmin) following last event dat, using Maximum Posteriori estimation. Setting tdm TRUE causes following occur: simulation starts time last recorded dose (TDM data) plus ; simulation stops time last recorded dose (TDM data) plus last_time; arguments dose, duration, estim_method, p, greater_than, interdose_interval, add_dose, indiv_param starting_time ignored. target_cmin Numeric. Target trough concentration (Cmin). dose Numeric. Dose administered. argument ignored tdm set TRUE. cmt_dose Character numeric. compartment dose administered. Must match one compartments prior model. Defaults 1. endpoint Character. endpoint prior model optimised . default \"Cc\", central concentration. estim_method character string. estimation method used individual parameters. default method \"map\" Maximum Posteriori estimation, method \"prior\" simulates prior population model, \"sir\" uses Sequential Importance Resampling algorithm estimate posteriori distribution individual parameters. argument ignored indiv_param provided, tdm set TRUE. nocb boolean. time-varying covariates: next observation carried backward (nocb) interpolation style, similar NONMEM. FALSE, last observation carried forward (locf) style used. Defaults FALSE. p Numeric. proportion distribution Cmin consider estimation. Mandatory estim_method=sir. argument ignored tdm set TRUE. greater_than boolean. TRUE: targets time leading proportion p cmins greater target_cmin. Respectively, lower FALSE. argument ignored tdm set TRUE. Numeric. Starting time simulation individual time-concentration profile. default value 0.2. tdm set TRUE simulation starts time last recorded dose plus . last_time Numeric. Ending time simulation individual time-concentration profile. default value 72. tdm set TRUE simulation stops time last recorded dose plus last_time. add_dose Numeric. Additional doses administered inter-dose interval first dose. Optional. argument ignored tdm set TRUE. interdose_interval Numeric. Time inter-dose interval multiple dose regimen. Must provided add_dose used. argument ignored tdm set TRUE. duration Numeric. Duration infusion, zero-order administrations. argument ignored tdm set TRUE. indiv_param Optional. set individual parameters : THETA, estimates ETA, covariates.","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the time required to reach a target trough concentration (Cmin) — poso_time_cmin","text":"list containing following components: time Numeric. Time needed reach selected Cmin. type_of_estimate Character string. type estimate individual parameters. Either point estimate, distribution. cmin_estimate vector numeric estimates Cmin. Either single value (point estimate ETA), distribution. indiv_param data.frame. set individual parameters used determination time needed reach selected Cmin: THETA, estimates ETA, covariates","code":""},{"path":"https://levenc.github.io/posologyr/reference/poso_time_cmin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the time required to reach a target trough concentration (Cmin) — poso_time_cmin","text":"","code":"rxode2::setRxThreads(2L) # limit the number of threads # model mod_run001 <- function() { ini({ THETA_Cl <- 4.0 THETA_Vc <- 70.0 THETA_Ka <- 1.0 ETA_Cl ~ 0.2 ETA_Vc ~ 0.2 ETA_Ka ~ 0.2 prop.sd <- sqrt(0.05) }) model({ TVCl <- THETA_Cl TVVc <- THETA_Vc TVKa <- THETA_Ka Cl <- TVCl*exp(ETA_Cl) Vc <- TVVc*exp(ETA_Vc) Ka <- TVKa*exp(ETA_Ka) K20 <- Cl/Vc Cc <- centr/Vc d/dt(depot) = -Ka*depot d/dt(centr) = Ka*depot - K20*centr Cc ~ prop(prop.sd) }) } # df_patient01: event table for Patient01, following a 30 minutes intravenous # infusion df_patient01 <- data.frame(ID=1, TIME=c(0.0,1.0,14.0), DV=c(NA,25.0,5.5), AMT=c(2000,0,0), EVID=c(1,0,0), DUR=c(0.5,NA,NA)) # predict the time needed to reach a concentration of 2.5 mg/l # after the administration of a 2500 mg dose over a 30 minutes # infusion poso_time_cmin(dat=df_patient01,prior_model=mod_run001, dose=2500,duration=0.5,from=0.5,target_cmin=2.5) #> #> #> #> #> $time #> [1] 20.5 #> #> $type_of_estimate #> [1] \"point estimate\" #> #> $cmin_estimate #> [1] 2.489933 #> #> $indiv_param #> THETA_Cl THETA_Vc THETA_Ka prop.sd ETA_Cl ETA_Vc ETA_Ka #> 1 4 70 1 0.2236068 0.6019036 -0.4291735 0.1278478 #>"},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":null,"dir":"Reference","previous_headings":"","what":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"creates posologyr error lines rxui model","code":""},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"","code":"posologyr_error_lines(line) # S3 method for class 'norm' posologyr_error_lines(line) # S3 method for class 't' posologyr_error_lines(line) # Default S3 method posologyr_error_lines(line) # S3 method for class 'rxUi' posologyr_error_lines(line)"},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"line line parse","code":""},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"error lines posology","code":""},{"path":"https://levenc.github.io/posologyr/reference/posologyr_error_lines.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"This creates the posologyr error lines from a rxui model — posologyr_error_lines","text":"Matthew L. Fidler","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-feature-1-2-4-9000","dir":"Changelog","previous_headings":"","what":"Additional feature","title":"posologyr v1.2.4.9000","text":"route administration (.e. compartment drug administered) can now specified poso_time_cmin(), poso_dose_conc(), poso_dose_auc() poso_inter_cmin().","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"documentation-1-2-4-9000","dir":"Changelog","previous_headings":"","what":"Documentation","title":"posologyr v1.2.4.9000","text":"README illustrates simple example dose adaptation vignette(\"route_of_administration\") shows select route administration optimal dosing vignette(\"population_models\") describes structure prior population models written model functions can parsed rxode2 used posologyr vignette(\"posologyr_user_defined_models\") renamed vignette(\"classic_posologyr_models\") Examples use rxode2 model functions","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"bug-fix-1-2-4-9000","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"posologyr v1.2.4.9000","text":"Fix bug poso_estim_map(), poso_estim_sir() poso_simu_pop() failed models featuring single parameter IIV.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v124","dir":"Changelog","previous_headings":"","what":"posologyr v1.2.4","title":"posologyr v1.2.4","text":"CRAN release: 2024-02-09 Add ability use rxode2 ui models poso_* functions. model parsed rxode2() package model$posologyr gives list needed poso_* functions","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"bug-fix-1-2-3","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"posologyr v1.2.3","text":"Fix bug poso_dose_conc(), poso_dose_auc() poso_inter_cmin() returned estimate target value optimized always equal zero.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"documentation-1-2-3","dir":"Changelog","previous_headings":"","what":"Documentation","title":"posologyr v1.2.3","text":"documentation poso_time_cmin(), poso_dose_conc(), poso_dose_auc() now explicitly states consequences setting tdm TRUE: parameters required, parameters ignored, parameters behave differently. functions poso_time_cmin(), poso_dose_conc(), poso_dose_auc() now return warning input parameters ignored. Fix incorrect information regarding duration AUC documentation poso_dose_auc()","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v122","dir":"Changelog","previous_headings":"","what":"posologyr v1.2.2","title":"posologyr v1.2.2","text":"CRAN release: 2023-06-12 Relax requirements NONMEM comparison test time-varying covariates account computational differences observed alternative BLAS ATLAS CRAN.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v121","dir":"Changelog","previous_headings":"","what":"posologyr v1.2.1","title":"posologyr v1.2.1","text":"CRAN release: 2023-06-05 Add reference Kang et al. (2012) doi:10.4196/kjpp.2012.16.2.97 DESCRIPTION (requested CRAN) Fix messages console internal function posologyr() (requested CRAN) Fix assignment parent environment dose optim functions, using parent.frame() (requested CRAN)","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-features-1-2-0","dir":"Changelog","previous_headings":"","what":"Additional features","title":"posologyr v1.2.0","text":"poso_estim_map(), poso_estim_sir() poso_estim_mcmc() can now estimate individual PK profiles multiple endpoints models (eg. PK-PD, parent-metabolite, blood-CSF…), using different residual error model endpoint. poso_time_cmin(), poso_dose_conc(), poso_dose_auc() poso_inter_cmin() now allow select end point interest want optimise, provided defined model.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"documentation-1-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"posologyr v1.2.0","text":"vignette(\"a_priori_dosing\") illustrates priori dose selection vignette(\"a_posteriori_dosing\") illustrates posteriori dose selection, using TDM data vignette(\"auc_based_dosing\") shows select optimal dose given target AUC using data TDM vignette(\"multiple_endpoints\") introduces new multiple endpoints feature","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"internal-changes-1-2-0","dir":"Changelog","previous_headings":"","what":"Internal changes","title":"posologyr v1.2.0","text":"description package updated","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-features-1-1-0","dir":"Changelog","previous_headings":"","what":"Additional features","title":"posologyr v1.1.0","text":"poso_time_cmin() can now estimate time needed reach selected trough concentration (Cmin) using data TDM directly poso_dose_conc() can now estimate optimal dose reach target concentration following events TDM poso_dose_auc() can now estimate optimal dose reach target auc following events TDM","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"breaking-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"posologyr v1.0.0","text":"posologyr() now internal function, exported functions take patient data prior model input parameters adaptive MAP forecasting option removed","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-features-1-0-0","dir":"Changelog","previous_headings":"","what":"Additional features","title":"posologyr v1.0.0","text":"poso_estim_map() provides rxode2 model using MAP-EBE input dataset, interpolation covariates, make plotting easier","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"internal-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Internal changes","title":"posologyr v1.0.0","text":"RxODE import updated rxode2 tests updated take account internalization posologyr() function","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"bug-fixes-1-0-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"posologyr v1.0.0","text":"poso_time_cmin(), poso_dose_auc(), poso_dose_conc(), poso_inter_cmin() longer fail models IOV","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v020","dir":"Changelog","previous_headings":"","what":"posologyr v0.2.0","title":"posologyr v0.2.0","text":"poso_estim_sir() estimates posterior distribution individual parameters Sequential Importance Resampling (SIR). roughly 25 times faster poso_estim_mcmc() 1000 samples. poso_estim_map() allows estimation individual parameters adaptive MAP forecasting (cf. doi: 10.1007/s11095-020-02908-7) adapt=TRUE. poso_simu_pop(), poso_estim_map(), poso_estim_sir() now support models inter-individual (IIV) inter-occasion variability (IOV). MASS:mvrnorm replaced mvtnorm::rmvnorm multivariate normal distributions. Input validation added exported functions. poso_estim_map() now uses method=“L-BFGS-B” optim better convergence algorithm. poso_inter_cmin() now uses method=“L-BFGS-B” optim better convergence algorithm. poso_dose_conc() new name poso_dose_ctime(). Issues #5 #6 fixed: poso_time_cmin(), poso_dose_auc(), poso_dose_conc(), poso_inter_cmin() now work prior posterior distributions ETA, point estimates (MAP). new nocb parameter added posologyr(). interpolation method time-varying covariates can either last observation carried forward (locf, RxODE default), next observation carried backward (nocb, NONMEM default). vignette(\"uncertainty_estimates\") removed. built-models removed.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v011","dir":"Changelog","previous_headings":"","what":"posologyr v0.1.1","title":"posologyr v0.1.1","text":"poso_time_cmin(), poso_dose_ctime(), poso_dose_auc() now work multiple dose regimen. poso_inter_cmin() allows optimization inter-dose interval multiple dose regimen. vignette(\"case_study_vancomycin\") illustrates AUC-based optimal dosing, multiple dose regimen, continuous intravenous infusion.","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v010","dir":"Changelog","previous_headings":"","what":"posologyr v0.1.0","title":"posologyr v0.1.0","text":"First public release.","code":""}] diff --git a/man/poso_dose_auc.Rd b/man/poso_dose_auc.Rd index 242e6c4..14a171f 100644 --- a/man/poso_dose_auc.Rd +++ b/man/poso_dose_auc.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/dosing_optim.R \name{poso_dose_auc} \alias{poso_dose_auc} -\title{Estimate the optimal dose for a selected target area under the -time-concentration curve (AUC)} +\title{Estimate the dose needed to reach a target area under the concentration-time +curve (AUC)} \usage{ poso_dose_auc( dat = NULL, @@ -114,9 +114,9 @@ covariates} } } \description{ -Estimates the optimal dose for a selected target area under the -time-concentration curve (AUC) given a population pharmacokinetic -model, a set of individual parameters, and a target AUC. +estimates the dose needed to reach a target area under the concentration-time +curve (AUC) given a population pharmacokinetic model, a set of individual +parameters, and a target AUC. } \examples{ rxode2::setRxThreads(2L) # limit the number of threads diff --git a/man/poso_dose_conc.Rd b/man/poso_dose_conc.Rd index 5712a72..89ae38e 100644 --- a/man/poso_dose_conc.Rd +++ b/man/poso_dose_conc.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/dosing_optim.R \name{poso_dose_conc} \alias{poso_dose_conc} -\title{Estimate the optimal dose for a selected target concentration} +\title{Estimate the optimal dose to achieve a target concentration at any given time} \usage{ poso_dose_conc( dat = NULL, @@ -109,10 +109,9 @@ covariates} } } \description{ -Estimates the optimal dose for a selected target concentration at a -selected point in time given a population pharmacokinetic model, a set -of individual parameters, a selected point in time, and a target -concentration. +Estimates the optimal dose to achieve a target concentration at any given +time given a population pharmacokinetic model, a set of individual +parameters, a selected point in time, and a target concentration. } \examples{ rxode2::setRxThreads(2L) # limit the number of threads diff --git a/man/poso_inter_cmin.Rd b/man/poso_inter_cmin.Rd index 9545904..96590f8 100644 --- a/man/poso_inter_cmin.Rd +++ b/man/poso_inter_cmin.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/dosing_optim.R \name{poso_inter_cmin} \alias{poso_inter_cmin} -\title{Estimate the optimal inter-dose interval for a given dose and a -selected target trough concentration} +\title{Estimate the optimal dosing interval to consistently achieve a target trough +concentration (Cmin)} \usage{ poso_inter_cmin( dat = NULL, @@ -86,10 +86,9 @@ covariates} } } \description{ -Estimates the optimal inter-dose interval for a selected target -trough concentration (Cmin), given a dose, a population -pharmacokinetic model, a set of individual parameters, and a -target concentration. +Estimates the optimal dosing interval to consistently achieve a target Cmin, +given a dose, a population pharmacokinetic model, a set of individual +parameters, and a target concentration. } \examples{ rxode2::setRxThreads(2L) # limit the number of threads diff --git a/man/poso_time_cmin.Rd b/man/poso_time_cmin.Rd index 5ebf5fd..53b510c 100644 --- a/man/poso_time_cmin.Rd +++ b/man/poso_time_cmin.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/dosing_optim.R \name{poso_time_cmin} \alias{poso_time_cmin} -\title{Predict time to a selected trough concentration} +\title{Estimate the time required to reach a target trough concentration (Cmin)} \usage{ poso_time_cmin( dat = NULL, @@ -117,8 +117,8 @@ estimates of ETA, and covariates} } } \description{ -Predicts the time needed to reach a selected trough concentration -(Cmin) given a population pharmacokinetic model, a set of individual +Estimates the time required to reach a target trough concentration (Cmin) +given a population pharmacokinetic model, a set of individual parameters, a dose, and a target Cmin. } \examples{