A SAS BASED SOLUTION FOR NONMEM RUN AND POST-PROCESSING - zip file
Objectives: While the NONMEM algorithm remains the centerpiece of population analysis workflow, data assembly, pre and post processing are functions typically handled outside of NONMEM. Although SAS offers an excellent platform for these tasks, it has often been excluded from such analyses because the user community is not as invested with SAS, cost, and previously inferior graphics to other algorithms. We have created a SAS-based environment to assemble NONMEM datasets from template input files, perform data checking, manage NONMEM runs, summarize run output within and across projects, and provide flexible post-processing including the management of scripts written in other 4th generation languages and compilers (R, FORTRAN, etc)
Methods: SAS scripts create NONMEM ready datasets for single and multiple analytes, and various input regimens. Templates for fixed format input files are created to import data into the SAS script. The NM_SAS script runs NONMEM and performs the user-specified post-processing (compatible with NONMEM 5, 6 or 7). Users must define environment variables including the path of the NONMEM executable. The script changes the directory as specified using the X command. The PIPE command and FILENAME is used in SAS to run NONMEM. The PIPE command writes the output from the command prompt into the SAS log to aid debugging NONMEM. Upon successful NONMEM execution, all relevant tab files are created in this directory.
CWRES calculation in NONMEM 6 is accomplished by calling R within SAS; the COMP.R script (Xpose) calculates the CWRES tab file assuming the NONMEM 6 control stream contains the necessary arrays (HH, GG etc) to output the CWTAB.est or derive file (not required in NONMEM 7). The runs are managed within user-defined folder structure. The control stream is saved in the main folder and copied into the specific RUN folder by SAS. A Runlog is created using the RUNLOG.for file (Metrum Institute). With the new ODS graphics features in SAS 9.2 panel plots, matrix plots etc are easily generated. Templates can be created so two or three plots can be placed in rows or columns. The script can be changed by advanced SAS users as they deem fit. Diagnostic plots can be output as JPG, EMF or PDF files. Development and testing has been conducted on a Windows XP environment, but this solution is easily ported to LINUX-based machines and server environments.
Results: Representative output from NM_SAS post-processing including diagnostic plots, run log summaries, Q-Q plots for CWRES, histograms of ETA distributions, co-plots (matrix layout) and observation density within sampling windows will be shown. A demo notebook will be available to observe real-time operation.
Conclusions: This SAS-based solution provides a viable option to the pre-and post-processing requirements for analysis of data with the NONMEM algorithm. This solution is provided to the pharmacometrics community ( http://www.med.upenn.edu/kmas/) in the hope that its future development and functionality will be expanded.