
Goodness of fit testing for detection function models. For continuous
distances Kolmogorov-Smirnov and Cramer-von Mises tests can be used, when
binned or continuous distances are used a
gof_ds(
model,
plot = TRUE,
chisq = FALSE,
nboot = 100,
ks = FALSE,
nc = NULL,
breaks = NULL,
...
)
a fitted detection function.
if TRUE
the Q-Q plot is plotted
if TRUE
then chi-squared statistic is calculated even
for models that use exact distances. Ignored for models that use binned
distances
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)
number of evenly-spaced distance classes for chi-squared test, if
chisq=TRUE
vector of cutpoints to use for binning, if chisq=TRUE
other arguments to be passed to ddf.gof
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).
# NOT RUN {
# fit and test a simple model for the golf tee data
library(Distance)
data(book.tee.data)
tee.data <- subset(book.tee.data$book.tee.dataframe, observer==1)
ds.model <- ds(tee.data,4)
# don't make plot
gof_ds(ds.model, plot=FALSE)
# }
Run the code above in your browser using DataLab