GoF: Goodness-of-fit test based on the CvM and KS statistics

View source: R/GoF.R

GoFR Documentation

Goodness-of-fit test based on the CvM and KS statistics

Description

Goodness-of-fit test statistics are computed based on the Cramér–von Mises (CvM) and Kolmogorov–Smirnov (KS) test statistics proposed in Emura et al. (2015). P-value and critical values with significance levels of 0.01, 0.05 and 0.10 are also computed.

Usage

GoF(u.trunc, y.trunc, v.trunc,epsilon=1e-08,F0,B=500,F.plot = TRUE)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

epsilon

error tolerance for the self-consistency algorithm

F0

a function for the null distribution function

B

the number of bootstrap resamples (B=500 is the default)

F.plot

model diagnostic plot

Details

Details are seen from Emura et al.(2015).

Value

CvM

Test statistics, P-value, and critical values for the Cramér–von Mises (CvM) test

KS

Test statistics, P-value, and critical values for the Kolmogorov–Smirnov (KS) test

Author(s)

Takeshi Emura

References

Emura T, Konno Y, Michimae H (2015). Statistical inference based on the nonparametric maximum likelihood estimator under double-truncation. Lifetime Data Analysis 21: 397-418

Examples

## A data example from Efron and Petrosian (1999) ## 
y.trunc=c(0.75, 1.25, 1.50, 1.05, 2.40, 2.50, 2.25)
u.trunc=c(0.4, 0.8, 0.0, 0.3, 1.1, 2.3, 1.3)
v.trunc=c(2.0, 1.8, 2.3, 1.4, 3.0, 3.4, 2.6)
F0=function(x){x/3}
GoF(u.trunc,y.trunc,v.trunc,F0=F0)

double.truncation documentation built on April 4, 2025, 3:31 a.m.