Learn R Programming

nmw (version 0.3.0)

Understanding Nonlinear Mixed Effects Modeling for Population Pharmacokinetics

Description

This shows how NONMEM(R) software works. NONMEM's classical estimation methods like 'First Order(FO) approximation', 'First Order Conditional Estimation(FOCE)', and 'Laplacian approximation' are explained. Additionally, provides functions for post-run processing of NONMEM output files, generating comprehensive PDF diagnostic reports including objective function value analysis, parameter estimates, prediction diagnostics, residual diagnostics, empirical Bayes estimate (EBE) analysis, input data summary, and individual pharmacokinetic parameter distributions.

Copy Link

Version

Install

install.packages('nmw')

Monthly Downloads

668

Version

0.3.0

License

GPL-3

Maintainer

Kyun-Seop Bae

Last Published

May 8th, 2026

Functions in nmw (0.3.0)

EBEpair

EBE Pair Plot
GetReason

Get Termination Reason from PRINT.OUT
FileTag

Check for Tag in File
GetCountPara

Get Count of Parameters
PanelCor

Correlation Panel for Pairs Plot
LogDV2

Check if Model Uses Log-Transformed DV (from FSUBS)
ResTest

Residual Count Test Using Binomial Distribution
MinUtil

Internal Min Util Functions
PanelChar

Character Panel for Pairs Plot
DxPlotPost

Diagnostic Plot for Post-Processing
LogDV

Check if Model Uses Log-Transformed DV (from Control File)
MinSuccess

Check Minimization Success
GetCountEta

Get Count of Etas
GetCountFixedTheta

Get Count of Fixed Thetas
PrepPDF

Prepare PDF Output
PlotDistribution

Plot Distribution Panel (Summary + Histogram + QQ)
MergeIDStatOFV

Merge IDStat with Individual OFV from PHI
MatchEnd

Match End of String
IntStat

Integer Variable Statistics
InitStep

Initialization Step
GetOFV

Get Objective Function Value
GetCountUnfixedEps

Get Count of Unfixed Epsilons
GetOffDiagOmega

Get Off-Diagonal Omega Count
mlr2

Multiple Linear Regression with Influence Diagnostics
ReadFDATA

Read FDATA.CSV with Auto-Detection of Header Format
SumOut1

Summarize Single NONMEM Run
nm_to_molar

Convert NM Dataset from Mass to Molar Units
nmw_report_ofv

Generate OFV Diagnostic Report (S1-OFV.PDF)
ParseItemWidth

Parse Fixed-Width Format Item Widths from NONMEM Output
ReadEXTFile

Read EXT File from Current Directory
TabStep

Table Step
add_crcl_cg

Add CRCL Column via Cockcroft-Gault
NMIDStat

NONMEM Individual (ID) Statistics
RemoveNA

Remove Rows with NA Values
Outline

Draw Model Development Flow Diagram
nmw_report_input

Generate Input Data Summary Report (SA-Input.PDF)
NMVarStat

NONMEM Variable Statistics
nmw_report_indipk

Generate Individual PK Parameter Report (SC-IndiPK.PDF)
TrimOut

Trimming and beautifying NONMEM original OUTPUT file
Objs

Internal Obj Functions
RenCol

Rename Columns
ParseOut

Parse Value After Tag from NONMEM Output
RmvCol

Remove Columns from Table
build_dose_records

Build NONMEM Dose Records
build_nm_dataset

Build a NONMEM-Format Dataset from DM/EX/PC
nmw_report_resid

Generate Residual Diagnostics Report (S4-Residuals.PDF)
nmw_report_ebe

Generate EBE Diagnostics Report (S5-EBE.PDF)
nmw-package

Understanding Nonlinear Mixed Effects Modeling for Population Pharmacokinetics
dat2_time_to_posix

Combine Date and Time Strings into POSIXct
code_race

Code RACE as Integer
build_obs_records

Build NONMEM Observation Records
RmvZero

Remove Zero Rows/Cols from Symmetric Matrix
run.test.nm

Runs Test for NONMEM Residuals
nmw_run

Run All NONMEM Post-Processing Reports
RmvFixed

Remove Fixed (Non-Varying) Columns
GetAICc

Get Corrected AIC (AICc)
ConnPoint

Connect Two Points with Lines
CountEXTParams

Count THETA, ETA, EPS Parameters from EXT Data Frame
FuncDep

Test Functional Dependency
nmw_report_output

Generate NONMEM Output Report (SB-Output.PDF)
e

environment for internal data
SESuccess

Check Standard Error Success
GetEstMethod

Get Estimation Method
GetModelNames

Get Model Names from Folder Names
PrinTxt

Print Text at Position
PrinMTxt

Print Multiple Lines of Text
GetCountAllTheta

Get Count of All Thetas
GetCountEps

Get Count of Epsilons
CombDmExPc

Combine the demographics(DM), dosing(EX), and DV(PC) tables into a new NONMEM dataset
OBJfpost

Post-Hoc OFV and CWRES Calculation
GetCountUnfixedTheta

Get Count of Unfixed Thetas
GetCurModelName

Get Current Model Name from Working Directory
locf_value

LOCF / LOCB Lookup
SumOut

Summarize Multiple NONMEM Runs
run.p

Run Test Probability
merge_cov_locf

Merge Time-Varying Covariates by LOCF
parse_dtc

Parse SDTM-Style DTC Strings into POSIXct
OFV_SCREEN_LAYOUT

OFV Report Split Screen Layout
ParseItemName

Parse Data Item Names from NONMEM Output
PanelHist

Histogram Panel for Pairs Plot
crcl_cg

Cockcroft-Gault Creatinine Clearance
nmw_report_param

Generate Parameter Estimates Report (S2-Parameters.PDF)
nmw_report_pred

Generate Prediction Diagnostics Report (S3-Predictions.PDF)
code_sex

Code SEX as Integer
AllSame

Check if All Values are the Same
BtwTagVals

Extract Vector of Values Between XML Tags
AddDoNoTaLD

Add Dose Number, Time of Latest Dose, and Time after Latest Dose
AddPage

Add a New Page to PDF
BtwTagMat

Extract Matrix from NONMEM XML Output
ExpandDoseHist

Expand Dose History with ADDL/II Records
GetCountObs

Get Count of Observations
ClosePDF

Close PDF Output
AddCox

Add a Covariate Column to an Existing NONMEM dataset
BtwTagLines

Extract Lines Between XML Tags
CovStep

Covariance Step
CalcTaLDForReport

Calculate TaLD (Time after Latest Dose) for Report Generation
EstStep

Estimation Step
BtwTagVal

Extract Value Between XML Tags
AllNA

Check if All Values are NA
GetProbVal

Get PROBLEM Statement Value
GetCountOmega

Get Count of Unfixed Omega Elements