Goodness-of-fit test for a model
iqr. The Kolmogorov-Smirnov statistic and the Cramer-Von Mises statistic
are computed. Their distribution under the null hypothesis is estimated
with Monte Carlo.
an object of class “
number of Monte Carlo replications.
a numeric value indicating how to model the joint distribution of censoring (C) and truncation (Z). Only used when data are censored and truncated. See ‘Details’.
logical. If TRUE, the progress be printed.
This function permits assessing goodness of fit by testing the null hypothesis that the CDF values follow a U(0,1) distribution, indicating that the model is correctly specified. Since the CDF values depend on estimated parameters, the distribution of the test statistic is not known. To evaluate it, the model is fitted on R simulated datasets generated under the null hypothesis.
If the data are censored and truncated,
object$CDF is as well a censored and truncated outcome,
and its quantiles must be estimated with Kaplan-Meier. The fitted survival curve is then compared with
To run Monte Carlo simulations when data are censored or truncated,
the distribution of the censoring and that of the truncation variable must be estimated:
pchreg from the pch package is used, with its option
splinex = splinex().
The joint distribution of the censoring variable (C) and the truncation variable (Z) can be specified in two ways:
If zcmodel = 1 (the default), it is assumed that C = Z + U, where U is a positive variable and is independent of Z, given covariates. This is the most common situation, and is verified when censoring occurs at the end of the follow-up. Under this scenario, C and Z are correlated with P(C > Z) = 1.
If zcmodel = 2, it is assumed that C and Z are conditionally independent. This situation is more plausible when all censoring is due to drop-out.
The testing procedure is described in details by Frumento and Bottai (2016, 2017).
a matrix with columns
reporting the Kolmogorov-Smirnov and Cramer-Von Mises statistic and the associated
p-values evaluated with Monte Carlo.
Paolo Frumento [email protected]
Frumento, P., and Bottai, M. (2016). Parametric modeling of quantile regression coefficient functions. Biometrics, 72 (1), pp 74-84, doi: 10.1111/biom.12410.
Frumento, P., and Bottai, M. (2017). Parametric modeling of quantile regression coefficient functions with censored and truncated data. Biometrics, doi: 10.1111/biom.12675.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.