Learn R Programming

Xpose 4

by Andrew C. Hooker, Mats O. Karlsson and E. Niclas Jonsson

Introduction

Xpose 4 is a collection of functions to be used as a model building aid for nonlinear mixed-effects (population) analysis using NONMEM. It facilitates data set checkout, exploration and visualization, model diagnostics, candidate covariate identification and model comparison.

Installation

To install xpose you will need R (>= version 2.2.0).
To install Xpose in R use one of the following methods:

  • latest stable release – From CRAN. Write at the R command line:

    install.packages("xpose4")
  • Latest development version – from Github. Note that the command below installs the “master” (development) branch; if you want the release branch from Github add ref="release" to the install_github() call.

    # install.packages("devtools")
    devtools::install_github("UUPharmacometrics/xpose4")

Running Xpose 4

Start R and load xpose:

library(xpose4)
#> Loading required package: lattice

To use the classic menu system, type at the R command prompt:

xpose4()

Each function is independently available from the command line, once the Xpose library is loaded.

First we create a set of files from a NONMEM run

cur.files <- dir() # current files in temp directory

simprazExample() # write files from an example NONMEM run
new.files <- dir()[!(dir() %in% cur.files)]  # the new files created by simprazExample

Then we can import our files to Xpose

xpdb <- xpose.data(1) 

Display goodness-of-fit plots:

basic.gof(xpdb)

Clean up files that were created to show these examples:

unlink(new.files)

More help is available in the online documentation, which can be found by typing (for example) ?xpose4 at the R command line.

The Xpose 4 Bestiary

A more detailed description of Xpose with example plots and explanaitions for most of the functions in the package is available in our Bestiarium: https://xpose.sourceforge.net/bestiarium_v1.0.pdf

Don’t Panic

Andrew Hooker (andrew.hooker at farmaci.uu.se) should be able to get you an answer if you run into trouble. The website https://uupharmacometrics.github.io/xpose4/ should also be of help.

Release Schedule

Bugfix releases will be released regularly, fixing any problems that are found.

License

Xpose 4 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details https://www.gnu.org/licenses/.

Known Bugs

None at present, but there will certainly be a few. Report them at https://github.com/UUPharmacometrics/xpose4/issues.

Copy Link

Version

Install

install.packages('xpose4')

Monthly Downloads

507

Version

4.7.3

License

LGPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Andrew C. Hooker

Last Published

February 22nd, 2024

Functions in xpose4 (4.7.3)

GAM_summary_and_plot

GAM functions for Xpose 4
absval.iwres.vs.ipred.by.cov

Absolute individual weighted residuals vs individual predictions, conditioned on covariates, for Xpose 4
absval.iwres.vs.cov.bw

box and whisker plots of the absolute value of the individual weighted residuals vs. covariates
absval.iwres.cwres.vs.ipred.pred

Absolute population weighted residuals vs population predictions, and absolute individual weighted residuals vs individual predictions, for Xpose 4
absval.iwres.vs.idv

absolute value of the individual weighted residuals vs. the independent variable
absval.cwres.vs.pred.by.cov

Absolute value of the conditional weighted residuals vs. population predictions, conditioned on covariates, for Xpose 4
absval.cwres.vs.cov.bw

Absolute conditional weighted residuals vs covariates for Xpose 4
absval.iwres.vs.ipred

Absolute individual weighted residuals vs individual predictions for Xpose 4
absval.iwres.vs.pred

Absolute individual weighted residuals vs population predictions or independent variable for Xpose 4
absval.cwres.vs.pred

Absolute population conditional weighted residuals vs population predictions for Xpose 4
absval.wres.vs.pred

Absolute population weighted residuals vs population predictions for Xpose 4
absval.wres.vs.pred.by.cov

Absolute population weighted residuals vs population predictions, conditioned on covariates, for Xpose 4
add_transformed_columns

Column-transformation functions for Xpose 4
addit.gof

Additional goodness-of-fit plots, for Xpose 4
absval.wres.vs.idv

Absolute value of (C)WRES vs. independent variable plot in Xpose4.
addid

Generic internal functions for Xpose 4
add.model.comp

Additional model comparison plots, for Xpose 4
add.grid.table

Print tables or text in a grid object
absval_delta_vs_cov_model_comp

Model comparison plots, of absolute differences in goodness-of-fit predictors against covariates, for Xpose 4
absval.wres.vs.cov.bw

Absolute weighted residuals vs covariates for Xpose 4
bootgam.print

Print summary information for a bootgam or bootscm
basic.gof

Basic goodness-of-fit plots, for Xpose 4
bootscm.import

Import bootscm data into R/Xpose
autocorr.iwres

autocorrelation of the individual weighted residuals
boot.hist

cat.pc

Categorical (visual) predictive check.
autocorr.cwres

Autocorrelation of conditional weighted residuals for Xpose 4
basic.model.comp

Basic model comparison plots, for Xpose 4
cat.dv.vs.idv.sb

Categorical observations vs. independent variable using stacked bars.
autocorr.wres

Autocorrelation of weighted residuals for Xpose 4
create.mirror

Function to create mirror plots from the generic Xpose plotting commands
change_graphical_parameters

Functions changing variable definitions in Xpose 4
change.xlabel

Changes the label of an Xpose data item
change.var.name

Changes the name of an Xpose data item
change.parm

Change parameter scope.
compute.cwres

Compute the Conditional Weighted Residuals
check.vars

Data functions for Xpose 4
change.xvardef

Change Xpose variable definitions.
categorical.table

Generic table functions for Xpose 4
change_misc_parameters

Functions changing miscellaneous parameter settings in Xpose 4
cwres.dist.hist

Histogram of conditional weighted residuals (CWRES), for Xpose 4
create.xpose.plot.classes

Create xpose.multiple.plot class.
cwres.wres.vs.idv

Weighted residuals (WRES) and conditional WRES (CWRES) plotted against the independent variable (IDV)
cwres.vs.idv.bw

Box-and-whisker plot of conditional weighted residuals vs the independent variable for Xpose 4
cwres.vs.idv

Population conditional weighted residuals (CWRES) plotted against the independent variable (IDV) for Xpose 4
cwres.vs.cov

Conditional Weighted residuals (CWRES) plotted against covariates, for Xpose 4
createXposeClasses

This function creates the Xpose data classes ("xpose.data" and "xpose.prefs")
cwres.dist.qq

Quantile-quantile plot of conditional weighted residuals (CWRES), for Xpose 4
cwres.vs.pred

Population conditional weighted residuals (CWRES) plotted against population predictions (PRED) for Xpose 4
cwres.vs.pred.bw

Box-and-whisker plot of conditional weighted residuals vs population predictions for Xpose 4
db.names

Prints the contents of an Xpose data object
cwres.wres.vs.pred

Weighted residuals (WRES) and conditional WRES (CWRES) plotted against the population predictions (PRED)
dOFV.vs.id

Change in Objective function value vs. removal of individuals.
dv.vs.ipred

Observations (DV) plotted against individual predictions (IPRED) for Xpose 4
data_extract_or_assign

Extract or assign data from an xpose.data object.
dOFV1.vs.dOFV2

Change in individual objective function value 1 vs. individual objective function value 2.
dOFV.vs.cov

Change in individual objective function value vs. covariate value.
dv.preds.vs.idv

Observations (DV), individual predictions (IPRED) and population predictions (IPRED) plotted against the independent variable (IDV), for Xpose 4
data.checkout

Check through the source dataset to detect problems
dv.vs.idv

Observations (DV) plotted against the independent variable (IDV) for Xpose 4
export.graph.par

Exports Xpose graphics settings to a file.
dv.vs.ipred.by.cov

Dependent variable vs individual predictions, conditioned on covariates, for Xpose 4
dv.vs.ipred.by.idv

Dependent variable vs individual predictions, conditioned on independent variable, for Xpose 4
dv.vs.pred.by.cov

Dependent variable vs population predictions, conditioned on covariates, for Xpose 4
find.right.table

Internal functions for the VPC
dv.vs.pred.by.idv

Dependent variable vs population predictions, conditioned on independent variable, for Xpose 4
export.variable.definitions

Exports Xpose variable definitions to a file from an Xpose data object.
gof

Structured goodness of fit diagnostics.
dv.vs.pred.ipred

Observations (DV) are plotted against individual predictions (IPRED) and population predictions (PRED), for Xpose 4
dv.vs.pred

Observations (DV) plotted against population predictions (PRED) for Xpose 4
iwres.dist.qq

Quantile-quantile plot of individual weighted residuals (IWRES), for Xpose 4
ind.plots.cwres.hist

Histograms of weighted residuals for each individual in an Xpose data object, for Xpose 4
kaplan.plot

Kaplan-Meier plots of (repeated) time-to-event data
import.graph.par

Imports Xpose graphics settings from a file to an Xpose data object.
ipred.vs.idv

Individual predictions (IPRED) plotted against the independent variable (IDV) for Xpose 4
iwres.dist.hist

Histogram of individual weighted residuals (IWRES), for Xpose 4
import.variable.definitions

Imports Xpose variable definitions from a file to an Xpose data object.
iwres.vs.idv

Individual weighted residuals (IWRES) plotted against the independent variable (IDV) for Xpose 4
ind.plots

Observations (DV), individual predictions (IPRED) and population predictions (PRED) are plotted against the independent variable for every individual in the dataset, for Xpose 4
ind.plots.cwres.qq

Quantile-quantile plots of weighted residuals for each individual in an Xpose data object, for Xpose 4
par_cov_summary

Summarize individual parameter values and covariates
cov.splom

Plot scatterplot matrices of parameters, random parameters or covariates
parm.vs.parm

Plot parameters vs other parameters
pred.vs.idv

Population predictions (PRED) plotted against the independent variable (IDV) for Xpose 4
npc.coverage

Function to plot the coverage of the Numerical Predictive Check
nsim

Extract or set the value of the Nsim slot.
make.sb.data

Make stacked bar data set.
par_cov_qq

Plot the parameter or covariate distributions using quantile-quantile (Q-Q) plots
par_cov_hist

Plot the parameter or covariate distributions using a histogram
parm.vs.cov

Parameters plotted against covariates, for Xpose 4
randtest.hist

read.nm.tables

Reading NONMEM table files
read_NM_output

Read NONMEM output files into Xpose 4
print.xpose.multiple.plot

Print an Xpose multiple plot object.
read_nm_table

Read NONMEM table files produced from simulation.
read.TTE.sim.data

Read (repeated) time-to-event simulation data files.
read.npc.vpc.results

Read the results file from a Numerical or Visual Predictive Check run in PsN
read.vpctab

Read the vpctab file from PsN into Xpose
ranpar.vs.cov

Random parameters plotted against covariates, for Xpose 4
reset.graph.par

Resets Xpose variable definitions to factory settings
wres.vs.cov

Weighted residuals (WRES) plotted against covariates, for Xpose 4
wres.vs.idv

Population weighted residuals (WRES) plotted against the independent variable (IDV) for Xpose 4
wres.dist.hist

Histogram of weighted residuals (WRES), for Xpose 4
wres.dist.qq

Quantile-quantile plot of weighted residuals (WRES), for Xpose 4
runsum

Print run summary in Xpose 4
simpraz.xpdb

Simulated prazosin Xpose database.
wres.vs.pred

Population weighted residuals (WRES) plotted against population predictions (PRED) for Xpose 4
wres.vs.idv.bw

Box-and-whisker plot of weighted residuals vs the independent variable for Xpose 4
xp.daic.npar.plot

Distribution of difference in AIC
xlabel

Extract and set labels for Xpose data items.
xp.get.disp

Default function for calculating dispersion in xpose.gam.
xp.inc.cond.stab.cov

Trace plots for conditional indices
wres.vs.pred.bw

Box-and-whisker plot of weighted residuals vs population predictions for Xpose 4
simprazExample

Function to create files for the simulated prazosin example in Xpose
xp.dofv.npar.plot

Distribution of difference in OFV
xp.dofv.plot

OFV difference (optimism) plot.
xp.boot.par.est.corr

Correlations between covariate coefficients
xp.boot.par.est

Compare parameter estimates for covariate coefficients
tabulate.parameters

Tabulate the population parameter estimates
xp.distr.mod.size

Plot of model size distribution for a bootgam or bootscm
xp.inc.ind.cond.stab.cov

Trace plots for conditional indices rper replicate number
xp.incl.index.cov.ind

Individual inclusion index
xp.incl.index.cov

Plot of inclusion index of covariates.
xp.inc.prob.comb.2

Inclusion frequency plot for combination of covariates.
xp.scope3

Define a scope for the gam. Used as default input to the scope argument in xpose.gam
xp.inc.prob

Inclusion frequency plot
xp.incl.index.cov.comp

Inclusion index individuals, compare between covariates.
xpose.VPC

Visual Predictive Check (VPC) using XPOSE
xpose.VPC.both

Xpose Visual Predictive Check (VPC) for both continuous and Limit of Quantification data.
xp.inc.stab.cov

Inclusion stability plot A plot of the inclusion frequency of covariates vs bootgam/bootscm iteration number. This plot can be used to evaluate whether sufficient iterations have been performed.
xpose.bootgam

Title
xpose.create.title.text

Create Xpose title text for plots.
xpose.VPC.categorical

Xpose visual predictive check for categorical data.
xpose.ask.for.filename

Function to ask the user for the name of a file
xpose.create.title

Functions to create labels for plots
xpose.data

Create an Xpose data object
xpose.gam

Stepwise GAM search for covariates on a parameter (Xpose 4)
xpose.dev.new

Create a new graphical device for an Xpose plot.
xpose.license.citation

Displays the Xpose license and citation information
xpose.data-class

Class xpose.data
xpose.multiple.plot-class

Class for creating multiple plots in xpose
xpose.multiple.plot.default

Xpose 4 generic function for plotting multiple lattice objects on one page
xpose.panel.histogram

Default histogram panel function for Xpose 4
xpose.multiple.plot

Create and object with class "xpose.multiple.plot".
xpose.plot.bw

The generic Xpose functions for box-and-whisker plots
xpose.plot.default

The Xpose 4 generic functions for continuous y-variables.
xpose.panel.splom

Scatterplot matrix panel function for Xpose 4
xpose.panel.qq

Default QQ panel function for Xpose 4
xpose.panel.bw

Default box-and-whisker panel function for Xpose 4
xpose.panel.default

Default panel function for Xpose 4
xpose.logTicks

Functions to create nice looking axes when using Log scales.
xpose.print

Summarize an xpose database
xpose.string.print

Print a pretty string.
xpose.prefs-class

Class "xpose.prefs"
xpose.plot.histogram

The Xpose 4 generic functions for continuous y-variables.
xpose4

Classic menu system for Xpose 4
xpose.plot.splom

The Xpose 4 generic functions for scatterplot matrices.
xpose4-package

The Xpose Package
xvardef

Extract and set Xpose variable definitions.
xpose.plot.qq

The generic Xpose functions for QQ plots
xsubset

Extract or set the value of the Subset slot.