Generic function that computes chi-square goodness of fit test for detection function models with binned data and Cramer-von Mises and Kolmogorov-Smirnov (if ks=TRUE
)tests for exact distance data. By default a Q-Q plot is generated for exact data (and can be suppressed using the qq=FALSE
argument).
ddf.gof(
model,
breaks = NULL,
nc = NULL,
qq = TRUE,
nboot = 100,
ks = FALSE,
...
)
model object
Cutpoints to use for binning data
Number of distance classes
Flag to indicate whether quantile-quantile plot is desired
number of replicates to use to calculate p-values for the Kolmogorov-Smirnov goodness of fit test statistics
perform the Kolmogorov-Smirnov test (this involves many bootstraps so can take a while)
Graphics parameters to pass into qqplot function
List of class ddf.gof
containing
Goodness of fit test statistic
Degrees of freedom associated with test statistic
Significance level of test statistic
Note that a bootstrap procedure is required for the Kolmogorov-Smirnov test to ensure that the p-values from the procedure are correct as the we are comparing the cumulative distribution function (CDF) and empirical distribution function (EDF) and we have estimated the parameters of the detection function. The nboot
parameter controls the number of bootstraps to use. Set to 0
to avoid computing bootstraps (much faster but with no Kolmogorov-Smirnov results, of course).