Learn R Programming

npde (version 3.5)

autonpde: Compute normalised prediction distribution errors

Description

These functions compute normalised prediction distribution errors (npde) and prediction discrepancies (pd). npde asks the user the name and structure of the files containing the data, using pdemenu, while autonpde takes these variables and others as arguments.

Usage

autonpde(namobs, namsim, iid, ix, iy, imdv = 0, icens = 0,
icov = 0, iipred = 0, boolsave = TRUE, namsav = "output", type.graph = "eps",
verbose = FALSE, calc.npde=TRUE, calc.npd=TRUE, decorr.method = "cholesky",
 cens.method = "cdf", units = list(x="",y=""), detect=FALSE, ties=TRUE, header=TRUE)

npde()

npde()

Value

An object of class NpdeObject

Arguments

namobs

name of the file containing the observed data, or a dataframe containing the observed data (in both cases, the column containing the various data required for the computation of the pde can be set using the arguments iid,ix and iy below)

namsim

name of the file containing the simulated data, or a dataframe containing the simulated data (the program will assume that subject ID are in column 1 and simulated Y in column 3, see User Guide)

iid

name/number of the column in the observed data containing the patient ID; if missing, the program will attempt to detect a column named id

ix

name/number of the column in the observed data containing the independent variable (X); ; if missing, the program will attempt to detect a column named X

iy

name/number of the column in the observed data containing the dependent variable (Y); if missing, the program will attempt to detect a column with the response

imdv

name/number of the column containing information about missing data (MDV), defaults to 0 (column not present)

icens

name/number of the column containing information about censored data (cens), defaults to 0 (column not present)

icov

name/number of the column(s) containing covariate information defaults to 0 (no covariates)

iipred

name/number of the column(s) with individual predictions (ipred), defaults to 0 (individual predictions not available)

boolsave

a boolean (TRUE if graphs and results are to be saved to a file, FALSE otherwise), defaults to TRUE

namsav

name of the files to which results are to be saved (defaults to "output", which will produce a file called output.eps (if the default format of postscript is kept, see type.graph) for the graphs and a file called output.npde for the numerical results (see value)

type.graph

type of graph (one of "eps","jpeg","png","pdf"), defaults to postscript ("eps")

verbose

a boolean (TRUE if messages are to be printed as each subject is processed, FALSE otherwise), defaults to FALSE

calc.npde

a boolean (TRUE if npde are to be computed, FALSE otherwise), defaults to TRUE

calc.npd

a boolean (TRUE if npd are to be computed, FALSE otherwise), defaults to TRUE

decorr.method

a character string indicating the method used to decorrelate observed and simulated data in the computation of npde (see npde.decorr.method) defaults to cholesky

cens.method

a character string indicating the method used to handle censored data (see npde.cens.method) defaults to cdf

units

a list with components x, y and cov (optional), specifying the units respectively for the predictor (x), the response (y), and the covariates (a vector of length equal to the number of covariates). Units will default to (-) if not given.

detect

a boolean controlling whether automatic recognition of columns in the dataset is on, defaults to FALSE

ties

a boolean (if FALSE, the distributions of pd and npde are smoothed by jittering the values so that there are no ties), defaults to TRUE

header

a boolean (TRUE if input files have headers, FALSE otherwise), defaults to TRUE

Author

Emmanuelle Comets <emmanuelle.comets@bichat.inserm.fr>

Details

Both functions compute the normalised prediction distribution errors (and/or prediction discrepancies) in the same way. npde is an interactive function whereas autonpde takes all required input as arguments.

Diagnostic graphs are produced for npd, and npde are used in the tests as their distribution takes into account the correlation between repeated observations.

When the computation of npde fails because of numerical problems, error messages are printed out, then pd are computed instead and graphs of pd are plotted so that the user may evaluate why the computation failed.

The function also prints out the characteristics of the distribution of the npde (mean, variance, skewness and kurtosis) as well as the results of the statistical tests applied to npde. In addition, if boolsave is TRUE, two files are created:

results file

the numerical results are saved in a file with extension .npde (the name of which is given by the user). The file contains the components id, xobs, ypred, npde, pd stored in columns

graph file

the graphs are saved to a file with the same name as the results file, and with extension depending on the format.

References

K. Brendel, E. Comets, C. Laffont, C. Laveille, and F. Mentre. Metrics for external model evaluation with an application to the population pharmacokinetics of gliclazide. Pharmaceutical Research, 23:2036--49, 2006.

PDF documentation for npde 3.0: https://github.com/ecomets/npde30/blob/main/userguide_npde_3.0.pdf

See Also

npde.graphs, gof.test

Examples

Run this code
data(theopp)
data(simtheopp)

# Calling autonpde with dataframes
x<-autonpde(theopp,simtheopp,1,3,4,boolsave=FALSE)
x
head(x["results"]["res"])
# \donttest{
plot(x)
# }

Run the code above in your browser using DataLab