From 964b1225fb760bfa77a7df7bda9ce895f981f447 Mon Sep 17 00:00:00 2001 From: levenc Date: Tue, 3 Sep 2024 22:06:42 +0200 Subject: [PATCH] update pkgdown website --- docs/articles/a_priori_dosing.html | 1 + docs/index.html | 4 ++-- docs/news/index.html | 2 +- docs/pkgdown.yml | 2 +- docs/search.json | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/articles/a_priori_dosing.html b/docs/articles/a_priori_dosing.html index 786c16a..8b1acf2 100644 --- a/docs/articles/a_priori_dosing.html +++ b/docs/articles/a_priori_dosing.html @@ -225,6 +225,7 @@

Plotting the selected dosage
 simu_patA$model$time <- seq(0,20,b=0.1)
+#> Warning: can not update object
 simu_patA$model$add.dosing(dose=prior_dose$dose,rate=prior_dose$dose/0.5)

Plotting the simulated scenario.

diff --git a/docs/index.html b/docs/index.html
index afc6fc2..44b0e23 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -17,8 +17,8 @@
 
 
 
-
-
+
+
 
 
 
diff --git a/docs/news/index.html b/docs/news/index.html
index d747876..f038733 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -49,7 +49,7 @@
     
-

posologyr v1.2.6

+

posologyr v1.2.6

CRAN release: 2024-08-27

  • Use undirected quotes when quoting in the DESCRIPTION (as requested by CRAN)
  • CRAN test times have been reduced by using an environment variable to identify the development machine, which now determines whether less critical tests are executed (as requested by CRAN)
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 5bab8f9..85e0b7a 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -10,7 +10,7 @@ articles: patient_data: patient_data.html population_models: population_models.html route_of_administration: route_of_administration.html -last_built: 2024-08-27T15:29Z +last_built: 2024-09-03T20:00Z urls: reference: https://levenc.github.io/posologyr/reference article: https://levenc.github.io/posologyr/articles diff --git a/docs/search.json b/docs/search.json index 49be32a..c5d5cb2 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) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"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) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> $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) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"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) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> $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; }) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"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) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ 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) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ 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\") #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> $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) #> #> #> #> #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> $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.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.12788489 -0.8474363696 0.972933500 #> 2 0.15044931 -0.6165957725 -0.288257826 #> 3 -0.26290512 0.5912277997 -1.384240405 #> 4 0.06358117 -1.0524378667 0.292384536 #> 5 -0.04738660 0.3020810818 0.017593578 #> 6 0.08829972 1.0646795643 0.177153842 #> 7 -0.56754035 -0.3004684498 0.086744472 #> 8 -0.17353057 0.0297399528 -0.239102222 #> 9 -0.37204606 -0.0681723758 0.667158179 #> 10 0.13349896 0.0284245681 0.181822898 #> 11 -0.12622407 0.6860145096 -0.234266909 #> 12 -0.24704093 -0.0306282674 -0.549257201 #> 13 -0.16917794 0.4382400402 -0.012830985 #> 14 0.19623634 0.7074781593 -0.136171803 #> 15 0.28794308 -0.0661337956 -0.073951692 #> 16 -0.10032863 -0.0136452244 -0.871130218 #> 17 -0.37228285 -0.0663627695 -0.336515849 #> 18 0.50185856 -0.1880645348 0.398147597 #> 19 0.16715147 0.7078051051 -0.294626263 #> 20 0.24462343 -0.0151938765 -0.366482185 #> 21 -0.78361129 -0.4687277771 0.172885315 #> 22 -0.14383402 0.6361751832 -0.223703774 #> 23 -0.14275268 -0.4155070297 0.001112369 #> 24 0.07919262 -0.0923541265 -1.028548245 #> 25 0.32541141 -0.3991711915 0.158204676 #> 26 -0.41127178 0.2498722022 0.534857269 #> 27 -0.24468315 0.1749402395 0.541677063 #> 28 -0.20073218 0.1098069426 0.994336524 #> 29 -0.28347955 -0.4408523470 0.175145338 #> 30 0.06856882 0.0635693077 0.328021625 #> 31 0.72545211 -0.3352657120 -0.722663525 #> 32 0.25653428 0.0234340351 -0.406303331 #> 33 0.37959016 0.3802766057 -0.076283200 #> 34 -0.31170568 0.7406108899 -0.065524473 #> 35 0.05754786 0.7310744062 -0.549295961 #> 36 0.08559765 0.1137295326 -0.326162522 #> 37 0.12743126 0.4451818055 -0.237158833 #> 38 -0.06270716 -0.8739258173 0.548334921 #> 39 -0.55583095 -0.3039715802 0.445685750 #> 40 -0.12034899 -0.2824848002 0.556723874 #> 41 0.41352429 -0.3565260587 -0.343045638 #> 42 -0.25671247 0.4915157307 0.366315463 #> 43 -0.01111643 -0.4709172790 -0.087432011 #> 44 -0.38215972 -0.7138946687 -0.677261388 #> 45 -0.76348667 0.1181884539 -0.546778736 #> 46 -0.21289274 0.2845195196 0.837286700 #> 47 0.12095204 0.1063290947 1.054290892 #> 48 -0.65677056 0.6579158907 0.208758285 #> 49 -0.01757885 -0.0588808083 0.371926925 #> 50 -0.24673067 -0.1805240163 -0.097830097 #> 51 0.39191046 0.4159538681 -0.037967541 #> 52 -0.87001416 -0.0101960308 -0.244342202 #> 53 0.69353025 0.3160638259 0.007746790 #> 54 0.76718629 -0.5305894330 0.687736930 #> 55 -0.15600010 -0.5372649408 0.233664676 #> 56 -0.22696478 0.3977303316 -0.325538825 #> 57 0.34939402 0.3356843830 -0.460650352 #> 58 -0.33446585 -0.4592726994 -0.762361942 #> 59 0.56771730 -0.0018453990 0.164049535 #> 60 0.02221040 -0.2074472251 -0.245654268 #> 61 -0.43756583 0.4004970612 -0.323059623 #> 62 0.22864983 -0.1643911881 -0.385340511 #> 63 0.04960210 -0.9753202418 -0.156391704 #> 64 0.41269427 0.9290324438 0.488513823 #> 65 0.48279891 0.5271998013 -0.145369898 #> 66 -0.01509115 -0.3794736224 0.633903308 #> 67 0.07928208 0.2879443073 -0.147487550 #> 68 0.20664080 0.0326334612 0.362415054 #> 69 0.06363990 0.8187491113 0.398934107 #> 70 -0.06412535 0.4812014182 -0.191628561 #> 71 0.44473418 0.3355002381 -0.190077991 #> 72 -0.35786214 -0.6259152421 0.309481419 #> 73 0.39099910 -0.8330321749 0.258486502 #> 74 0.60591300 0.7522020684 0.003734992 #> 75 0.14105591 -0.0772794560 0.199033893 #> 76 0.11255801 0.0686682135 -0.014146813 #> 77 0.29403252 -0.7716550381 -0.377551574 #> 78 -0.10415015 -0.4098232879 -0.277269197 #> 79 0.04687274 0.3381934530 0.466881915 #> 80 -0.01657469 -0.0004508222 -0.274059996 #> 81 0.34703845 -0.1353410256 -0.518273028 #> 82 -0.77759568 0.0783792867 -0.009475904 #> 83 0.09837731 -0.2966746333 -0.151063236 #> 84 0.86918648 0.5425733777 -0.484762337 #> 85 -0.20056939 -0.0337251850 0.880821557 #> 86 0.22423405 0.2266253611 0.098053962 #> 87 -0.06289958 -0.0805403600 -0.328896523 #> 88 0.91974567 1.2345015201 1.176161346 #> 89 0.87918576 0.2155617721 0.643564140 #> 90 -0.82927912 -0.3592766936 -0.700110707 #> 91 -0.34914053 0.0990080614 -0.229746377 #> 92 -0.22935254 -0.0841394013 -0.248344505 #> 93 -0.22056017 0.1123495210 0.058659532 #> 94 -0.24618351 0.1502172258 -0.043350296 #> 95 0.61466996 0.3262538319 -0.020061632 #> 96 -0.26323832 -0.1269916789 0.930418768 #> 97 0.73455148 -0.0915474373 0.805957437 #> 98 -0.03921193 0.1359026367 0.274076390 #> 99 0.14639569 -0.1606572049 -0.790413751 #> 100 0.08872456 0.5419509531 -0.251199157 #> #> $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.128 -0.847 0.973 #> 2 2 4 70 1 0.224 0.150 -0.617 -0.288 #> 3 3 4 70 1 0.224 -0.263 0.591 -1.38 #> 4 4 4 70 1 0.224 0.0636 -1.05 0.292 #> 5 5 4 70 1 0.224 -0.0474 0.302 0.0176 #> 6 6 4 70 1 0.224 0.0883 1.06 0.177 #> 7 7 4 70 1 0.224 -0.568 -0.300 0.0867 #> 8 8 4 70 1 0.224 -0.174 0.0297 -0.239 #> 9 9 4 70 1 0.224 -0.372 -0.0682 0.667 #> 10 10 4 70 1 0.224 0.133 0.0284 0.182 #> # ℹ 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 centr #> #> 1 1 0 4 70 1 4.55 30.0 2.65 0.152 0 0 0 0 #> 2 1 0.1 4 70 1 4.55 30.0 2.65 0.152 1.61 1.61 351. 48.3 #> 3 1 0.2 4 70 1 4.55 30.0 2.65 0.152 5.90 5.90 621. 177. #> 4 1 0.3 4 70 1 4.55 30.0 2.65 0.152 12.2 12.2 828. 366. #> 5 1 0.4 4 70 1 4.55 30.0 2.65 0.152 20.0 20.0 987. 600. #> 6 1 0.5 4 70 1 4.55 30.0 2.65 0.152 28.9 28.9 1109. 867. #> # ℹ 15,094 more rows #> # ℹ 1 more variable: 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.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":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v126","dir":"Changelog","previous_headings":"","what":"posologyr v1.2.6","title":"posologyr v1.2.6","text":"Use undirected quotes quoting DESCRIPTION (requested CRAN) CRAN test times reduced using environment variable identify development machine, now determines whether less critical tests executed (requested CRAN)","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-feature-1-2-5","dir":"Changelog","previous_headings":"","what":"Additional feature","title":"posologyr v1.2.5","text":"route administration (.e. compartment drug administered) can now specified poso_time_cmin(), poso_dose_conc(), poso_dose_auc() poso_inter_cmin(). poso_simu_pop() provides rxode2 model using simulated ETA input dataset, interpolation covariates, make plotting easier","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"documentation-1-2-5","dir":"Changelog","previous_headings":"","what":"Documentation","title":"posologyr v1.2.5","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-5","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"posologyr v1.2.5","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) #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0'"},{"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) #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0' #> $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) #> Warning: can not update object 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) #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0'"},{"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) #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0' #> $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; }) #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0'"},{"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\")) #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0'"},{"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) #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0' 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 x 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 #> # i 1,445 more rows #> # i 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) #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0' 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\") #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_COLLATE failed, using \"C\" #> 3: Setting LC_TIME failed, using \"C\" #> 4: Setting LC_MESSAGES failed, using \"C\" #> 5: Setting LC_MONETARY failed, using \"C\" #> 6: Setting LC_PAPER failed, using \"C\" #> 7: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0' #> $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) #> #> #> #> #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_TIME failed, using \"C\" #> 3: Setting LC_MESSAGES failed, using \"C\" #> 4: Setting LC_MONETARY failed, using \"C\" #> 5: Setting LC_PAPER failed, using \"C\" #> 6: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0' #> $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) #> #> #> #> #> During startup - Warning messages: #> 1: Setting LC_CTYPE failed, using \"C\" #> 2: Setting LC_TIME failed, using \"C\" #> 3: Setting LC_MESSAGES failed, using \"C\" #> 4: Setting LC_MONETARY failed, using \"C\" #> 5: Setting LC_PAPER failed, using \"C\" #> 6: Setting LC_MEASUREMENT failed, using \"C\" #> using C compiler: 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0' #> $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 x 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. #> # i 145 more rows #> # i 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 x 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 #> # i 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 x 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 #> # i 194 more rows #> # i 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 x 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 #> # i 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 x 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 #> # i 194 more rows #> # i 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.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.12788489 -0.8474363696 0.972933500 #> 2 0.15044931 -0.6165957725 -0.288257826 #> 3 -0.26290512 0.5912277997 -1.384240405 #> 4 0.06358117 -1.0524378667 0.292384536 #> 5 -0.04738660 0.3020810818 0.017593578 #> 6 0.08829972 1.0646795643 0.177153842 #> 7 -0.56754035 -0.3004684498 0.086744472 #> 8 -0.17353057 0.0297399528 -0.239102222 #> 9 -0.37204606 -0.0681723758 0.667158179 #> 10 0.13349896 0.0284245681 0.181822898 #> 11 -0.12622407 0.6860145096 -0.234266909 #> 12 -0.24704093 -0.0306282674 -0.549257201 #> 13 -0.16917794 0.4382400402 -0.012830985 #> 14 0.19623634 0.7074781593 -0.136171803 #> 15 0.28794308 -0.0661337956 -0.073951692 #> 16 -0.10032863 -0.0136452244 -0.871130218 #> 17 -0.37228285 -0.0663627695 -0.336515849 #> 18 0.50185856 -0.1880645348 0.398147597 #> 19 0.16715147 0.7078051051 -0.294626263 #> 20 0.24462343 -0.0151938765 -0.366482185 #> 21 -0.78361129 -0.4687277771 0.172885315 #> 22 -0.14383402 0.6361751832 -0.223703774 #> 23 -0.14275268 -0.4155070297 0.001112369 #> 24 0.07919262 -0.0923541265 -1.028548245 #> 25 0.32541141 -0.3991711915 0.158204676 #> 26 -0.41127178 0.2498722022 0.534857269 #> 27 -0.24468315 0.1749402395 0.541677063 #> 28 -0.20073218 0.1098069426 0.994336524 #> 29 -0.28347955 -0.4408523470 0.175145338 #> 30 0.06856882 0.0635693077 0.328021625 #> 31 0.72545211 -0.3352657120 -0.722663525 #> 32 0.25653428 0.0234340351 -0.406303331 #> 33 0.37959016 0.3802766057 -0.076283200 #> 34 -0.31170568 0.7406108899 -0.065524473 #> 35 0.05754786 0.7310744062 -0.549295961 #> 36 0.08559765 0.1137295326 -0.326162522 #> 37 0.12743126 0.4451818055 -0.237158833 #> 38 -0.06270716 -0.8739258173 0.548334921 #> 39 -0.55583095 -0.3039715802 0.445685750 #> 40 -0.12034899 -0.2824848002 0.556723874 #> 41 0.41352429 -0.3565260587 -0.343045638 #> 42 -0.25671247 0.4915157307 0.366315463 #> 43 -0.01111643 -0.4709172790 -0.087432011 #> 44 -0.38215972 -0.7138946687 -0.677261388 #> 45 -0.76348667 0.1181884539 -0.546778736 #> 46 -0.21289274 0.2845195196 0.837286700 #> 47 0.12095204 0.1063290947 1.054290892 #> 48 -0.65677056 0.6579158907 0.208758285 #> 49 -0.01757885 -0.0588808083 0.371926925 #> 50 -0.24673067 -0.1805240163 -0.097830097 #> 51 0.39191046 0.4159538681 -0.037967541 #> 52 -0.87001416 -0.0101960308 -0.244342202 #> 53 0.69353025 0.3160638259 0.007746790 #> 54 0.76718629 -0.5305894330 0.687736930 #> 55 -0.15600010 -0.5372649408 0.233664676 #> 56 -0.22696478 0.3977303316 -0.325538825 #> 57 0.34939402 0.3356843830 -0.460650352 #> 58 -0.33446585 -0.4592726994 -0.762361942 #> 59 0.56771730 -0.0018453990 0.164049535 #> 60 0.02221040 -0.2074472251 -0.245654268 #> 61 -0.43756583 0.4004970612 -0.323059623 #> 62 0.22864983 -0.1643911881 -0.385340511 #> 63 0.04960210 -0.9753202418 -0.156391704 #> 64 0.41269427 0.9290324438 0.488513823 #> 65 0.48279891 0.5271998013 -0.145369898 #> 66 -0.01509115 -0.3794736224 0.633903308 #> 67 0.07928208 0.2879443073 -0.147487550 #> 68 0.20664080 0.0326334612 0.362415054 #> 69 0.06363990 0.8187491113 0.398934107 #> 70 -0.06412535 0.4812014182 -0.191628561 #> 71 0.44473418 0.3355002381 -0.190077991 #> 72 -0.35786214 -0.6259152421 0.309481419 #> 73 0.39099910 -0.8330321749 0.258486502 #> 74 0.60591300 0.7522020684 0.003734992 #> 75 0.14105591 -0.0772794560 0.199033893 #> 76 0.11255801 0.0686682135 -0.014146813 #> 77 0.29403252 -0.7716550381 -0.377551574 #> 78 -0.10415015 -0.4098232879 -0.277269197 #> 79 0.04687274 0.3381934530 0.466881915 #> 80 -0.01657469 -0.0004508222 -0.274059996 #> 81 0.34703845 -0.1353410256 -0.518273028 #> 82 -0.77759568 0.0783792867 -0.009475904 #> 83 0.09837731 -0.2966746333 -0.151063236 #> 84 0.86918648 0.5425733777 -0.484762337 #> 85 -0.20056939 -0.0337251850 0.880821557 #> 86 0.22423405 0.2266253611 0.098053962 #> 87 -0.06289958 -0.0805403600 -0.328896523 #> 88 0.91974567 1.2345015201 1.176161346 #> 89 0.87918576 0.2155617721 0.643564140 #> 90 -0.82927912 -0.3592766936 -0.700110707 #> 91 -0.34914053 0.0990080614 -0.229746377 #> 92 -0.22935254 -0.0841394013 -0.248344505 #> 93 -0.22056017 0.1123495210 0.058659532 #> 94 -0.24618351 0.1502172258 -0.043350296 #> 95 0.61466996 0.3262538319 -0.020061632 #> 96 -0.26323832 -0.1269916789 0.930418768 #> 97 0.73455148 -0.0915474373 0.805957437 #> 98 -0.03921193 0.1359026367 0.274076390 #> 99 0.14639569 -0.1606572049 -0.790413751 #> 100 0.08872456 0.5419509531 -0.251199157 #> #> $model #> -- Solved rxode2 object -- #> -- Parameters ($params): -- #> # A tibble: 100 x 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.128 -0.847 0.973 #> 2 2 4 70 1 0.224 0.150 -0.617 -0.288 #> 3 3 4 70 1 0.224 -0.263 0.591 -1.38 #> 4 4 4 70 1 0.224 0.0636 -1.05 0.292 #> 5 5 4 70 1 0.224 -0.0474 0.302 0.0176 #> 6 6 4 70 1 0.224 0.0883 1.06 0.177 #> 7 7 4 70 1 0.224 -0.568 -0.300 0.0867 #> 8 8 4 70 1 0.224 -0.174 0.0297 -0.239 #> 9 9 4 70 1 0.224 -0.372 -0.0682 0.667 #> 10 10 4 70 1 0.224 0.133 0.0284 0.182 #> # i 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 x 14 #> sim.id time TVCl TVVc TVKa Cl Vc Ka K20 rxCc Cc depot centr #> #> 1 1 0 4 70 1 4.55 30.0 2.65 0.152 0 0 0 0 #> 2 1 0.1 4 70 1 4.55 30.0 2.65 0.152 1.61 1.61 351. 48.3 #> 3 1 0.2 4 70 1 4.55 30.0 2.65 0.152 5.90 5.90 621. 177. #> 4 1 0.3 4 70 1 4.55 30.0 2.65 0.152 12.2 12.2 828. 366. #> 5 1 0.4 4 70 1 4.55 30.0 2.65 0.152 20.0 20.0 987. 600. #> 6 1 0.5 4 70 1 4.55 30.0 2.65 0.152 28.9 28.9 1109. 867. #> # i 15,094 more rows #> # i 1 more variable: 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 x 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 #> # i 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.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":"https://levenc.github.io/posologyr/news/index.html","id":"posologyr-v126","dir":"Changelog","previous_headings":"","what":"posologyr v1.2.6","title":"posologyr v1.2.6","text":"CRAN release: 2024-08-27 Use undirected quotes quoting DESCRIPTION (requested CRAN) CRAN test times reduced using environment variable identify development machine, now determines whether less critical tests executed (requested CRAN)","code":""},{"path":[]},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"additional-feature-1-2-5","dir":"Changelog","previous_headings":"","what":"Additional feature","title":"posologyr v1.2.5","text":"route administration (.e. compartment drug administered) can now specified poso_time_cmin(), poso_dose_conc(), poso_dose_auc() poso_inter_cmin(). poso_simu_pop() provides rxode2 model using simulated ETA input dataset, interpolation covariates, make plotting easier","code":""},{"path":"https://levenc.github.io/posologyr/news/index.html","id":"documentation-1-2-5","dir":"Changelog","previous_headings":"","what":"Documentation","title":"posologyr v1.2.5","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-5","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"posologyr v1.2.5","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":""}]