Learn R Programming

npde (version 3.5)

gof.test: Goodness-of-fit tests for npde

Description

Performs test on the selected variable (which=one of npde, pd or npd) or on a numeric vector

Usage

gof.test(object, parametric = TRUE, ...)

printgoftest(object, ...)

Value

A list with the following elements:

mean

mean

se.mean

standard error of the mean

var

variance

se.var

standard error on variance

kurtosis

kurtosis (see kurtosis)

skewness

skewness (see skewness)

p.value

p-values for several tests (see below)

Arguments

object

an object (currently has methods for types numeric, NpdeRes and NpdeObject)

parametric

a boolean. If TRUE (default), parametric tests are performed

...

additional arguments passed on to the function; special arguments are na.action, which controls how to handle NAs in the results (na.action), verbose (if FALSE, suppresses printing of the results) and covsplit which requests the tests to be performed split by categories or quantiles of the data. If covsplit is TRUE, continuous covariates will be split in 3 categories (<Q1, Q1-Q3, >Q3) (see details in the PDF documentation), but this behaviour can be overriden by passing the argument ncat=XXX where XXX is the number of categories to divide the continuous covariates in.

Details

If object is an NpdeObject and an argument covsplit=TRUE is given in ..., in addition to the global descriptive statistics and tests, tests will be performed for each covariate in which.cov. This argument can be set in ...; barring an explicit specification, the component which.cov of the prefs slot for a NpdeObject object will be used. The default value is which.cov="all", which produces tests for each covariate in the dataset. Two additional dataframes will then be present:

cov.stat

descriptive statistics and test p-values split by covariate and by categories

cov.p.value

p-values split by covariate; for each covariate, two tests are performed: the first test is a correlation test for continuous covariates and a Chi-square test for categorical covariates; the second test is defined using the p-values of the global tests split by each category, and appling a Bonferroni correction to obtain an overall p-value (see PDF documentation for details)

The p.value elements is a named vector with four components:

p.mean

p-value for the mean test (Wilcoxon test if parametric=FALSE, Student test if parametric=TRUE)

p.var

p-value for the variance test (parametric=FALSE, Fisher test if parametric=TRUE)

p.dist

p-value for the distribution test (Shapiro-test for normality (npd, npde)/Kolmogorove-Smirnov test for uniformity)

p.global

p-value for the global test (combination of the mean, variance and distribution tests with a Bonferroni correction)

The p-values are adjusted using a Bonferroni correction: the raw p-values of the 3 individual tests are multiplied by 3, and the p-value for the global test is equal to the minimum of the adjusted p-values.

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.

K. Brendel, E. Comets, C. Laffont, and F. Mentre. Evaluation of different tests based on observations for external model evaluation of population analyses. Journal of Pharmacokinetics and Pharmacodynamics, 37:49--65, 2010.

See Also

kurtosis, skewness

Examples

Run this code
# \donttest{
data(theopp)
data(simtheopp)
#' # Calling autonpde with dataframes
x<-autonpde(theopp,simtheopp,1,3,4,boolsave=FALSE)
gof.test(x)
# }

Run the code above in your browser using DataLab