`r lifecycle::badge("stable")`

`NPparse`

processes the output from an NPAG run into a list.

## Arguments

- outfile
This is the filename of the output from NPAG. Typically, the file will be called NP_RF0001.txt, and this is the default.

## Value

The output of `NPparse`

is a list with the following objects and
of the class *NPAG*.

- nsub
Number of subjects

- nactve
Number of active grid points at the final cycle

- nvar
Number of random variables or parameters in the model

- nofix
Number of fixed variables or parameters in the model

- par
Names of random parameters

- parfix
Names of fixed parameters

- covnames
Names of covariates

- ab
Initial boundaries for each random parameter

- valfix
Values for fixed parameters

- ndim
Number of differential equations in model, or 0 for only output equation, or -1 for analytic solution (algabraic)

- indpts
Index for the initial number of gridpoints in the model

- icycst
Starting cycle number

- icycmax
Maximum number of cycles specified by the user

- icyctot
Number of cycles run. If less than

`icycmax`

, convergence occurred.- converge
Boolean value if convergence occurred.

- ODEtol
Ordindary Differential Equation solver tolerance.

- prior
Prior density for the run, either “UNIFORM” or the name of the user-specified density file, typically “DEN0001”.

- ERRmod
Assay error model: 1 for SD; 2 for \(SD*gamma\); 3 for additive lambda model; and 4 for gamma only

- numeqt
Number of output equations

- ndrug
Number of drug inputs

- salt
Vector of values of the salt fraction for each

`ndrug`

- ndose
Vector of the number of doses for each subject in the population

- ncov
Number of covariates in the model

- nobs
Vector of the number of observations for each subject in the population

- nobsmax
Maximum number of observation in any individual subject

- numt
Vector of the number of time points for each subject at which a prediction is generated for each

*numeqt*output equation- corden
Final cycle joint population density of parameter estimates

- postden
Array of posterior parameter value distributions for the first 100 subjects at each observation time point.

*postden[nsub,nactvepost,density]*where*nactvepost*is the posterior grid point- pyjgx
Matrix of posterior probability of each

*nactve*point for each subject, given that subject's data- ypredpop
Array of population model predictions for each subject at each observation time point.

*ypredpop[nsub,numeqt,time,type]*where*type*is 1=mean, 2=median, 3=mode of the population prior used to calculate ypredpop- ypredbay
Array of Bayesian posterior model predictions for each subject at each observation time point.

*ypredbay[nsub,numeqt,time,type]*where*type*is 1=mean, 2=median, 3=mode of the population prior used to calculate ypredbay- ttpred
Matrix of the prediction time points for each subject, with

*nsub*rows and max(*numt*) columns- exx
Array of the mean, median, and mode of the posterior marginal distribution for each parameter in each subject, of the form

*exx[nvar,type,nsub]*- ypredpopt
Array of population model predictions for each subject at each

*ttpred*time point, of the form*ypredpopt[nsub, numeqt, time, type]*, where type is 1=mean, 2=median, 3=mode of the population prior used to calculate*ypredpopt*- ilog
Matrix of cycle number and associated log-likelihood

- iic
Matrix with cycle number and Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC) for each cycle

- imean
Matrix of cycle numbers and associated means for each random parameter

- isd
Matrix of cycle numbers and associated standard deviations for each random parameter

- iaddl
Array of additional information for each random parameter in each cycle, of the form

*iaddl[info, nvar, cycle]*, where info is a value from 1 to 12: 1= mode; 2= skewness; 3= kurtosis; 4-8 give percentiles of the distribution where 4=2.5%; 5=25%; 6=50% (median); 7=75%; 8=97.5%; 9= the standard deviation of a normal distribution with the same interquartile range; 10=the standard deviation of a normal distribution with the same 95% range; 11=the average of 9 and 10; 12=the % scaled information- igamlam
Matrix of cycle number and associated gamma or lambda

- blog
Vector of each subject's Bayesian posterior log-likelihood

- bmean
Matrix of subject numbers and associated Bayesian posterior means for each random parameter

- bsd
Matrix of subject numbers and associated Bayesian posterior standard deviations for each random parameter

- baddl
Array of Bayesian posterior additional information for each random parameter for each subject, of the form

*baddl[info, nvar, nsub]*, where info is the same as for*iaddl*.- bauc
Matrix of AUC blocks for each subject with 5 columns: [nsub, numeqt, nblock, tau, auc];

*nsub*and*numeqt*are as previously defined;*nblock*is the AUC block as defined by successive dose reset (evid=4) events;*tau*is the time interval for that block;*auc*is the AUC for that block- sdata
Subject data consisting of 5 columns: [id, nsub, age, sex, ht],

*id*is the original identification number in the .csv matrix file;*nsub*is the sequential subject number in the NPAG run;*age*,*sex*and*ht*will be missing for .csv input and present if included in .wrk input files- dosecov
Matrix with all dosing information for each subject, including times, routes, amounts, and associated covariate values

- outputs
Matrix with measured outputs for each subject and associated assay error polynomials. The order of the columns is nsub, time, numeqt, observation, c0, c1, c2, c3, where the last four columns are the coefficients of the assay error polynomial for that observation, such that \(SD[obs] = c0 + c1*[obs] + c2*[obs]**2 + c3*[obs]**3\)

- negflag
A flag indicating that some negative predictions were changed to missing. This means that the model may be misspecified.

- mdata
The filename of the data used in the run.

## Details

This function is called automatically at the end of a run. It can take some time to complete, depending on the number of subjects, doses, observations, etc. Typical wait times are a few seconds up to 5 minutes. When processing is complete a summary of the extracted data will be reported on the console.