test_diff | R Documentation |
It is in fact a model comparison between a null model where the parameters are enforced to be equal and an unconstrained full model.
As test statistic we use twice the difference in best (=lowest) objective function value, i.e. 2 * (val_0
- val_1
).
This is reminiscent of a likelihood ratio test statistic albeit the objective function is not a negative log-likelihood
but the negative of the maximum product spacing metric.
test_diff(
x,
y = stop("Provide data for group y!"),
distribution = c("exponential", "weibull"),
twoPhase = FALSE,
method = c("MPSE", "MLEn", "MLEw", "MLEc"),
profiled = method == "MLEw",
ties = c("density", "equidist", "random", "error"),
param = "delay1",
type = c("all", "bootstrap", "GOF", "moran", "pearson", "logrank", "LR"),
doLogrank = TRUE,
R = 400,
chiSqApprox = FALSE,
verbose = 0
)
x |
data from reference/control group. |
y |
data from the treatment group. |
distribution |
character(1). Name of the parametric delay distribution to use. |
twoPhase |
logical(1). Do we model two phases per group? Default is |
method |
character. Which method to fit the models. |
profiled |
logical. Use the profiled likelihood? |
ties |
character. How to handle ties in data vector of a group? |
param |
character. Names of parameters to test difference for. Default value is |
type |
character. Which type of tests to perform? |
doLogrank |
logical. In any case do log-rank based tests? |
R |
numeric(1). Number of bootstrap samples to evaluate the distribution of the test statistic. |
chiSqApprox |
logical flag. In bootstrap, should we calculate the approximate degrees of freedom for the distribution of the test statistic under H0? |
verbose |
numeric. How many details are requested? Higher value means more details. 0=off, no details. |
High values of this difference speak against the null-model (i.e. high val_0
indicates bad fit under 0-model and low values of val_1
indicate a good fit under the more general model1.
The test is implemented as a parametric bootstrap test, i.e. we
take given null-model fit as ground truth
regenerate data according to this model.
recalculate the test statistic
appraise the observed test statistic in light of the generated distribution under H0
list with the results of the test. Element P contains the different P-values, for instance from parametric bootstrap
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.