Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

qqplot.ddf

Quantile-quantile plot and goodness of fit tests for detection functions


Description

Constructs a quantile-quantile (Q-Q) plot for fitted model as a graphical check of goodness of fit. Formal goodness of fit testing for detection function models using Kolmogorov-Smirnov and Cramer-von Mises tests. Both tests are based on looking at the quantile-quantile plot produced by qqplot.ddf and deviations from the line x=y.

Usage

qqplot.ddf(model, plot = TRUE, nboot = 100, ks = FALSE, ...)

Arguments

model

fitted distance detection function model object

plot

the Q-Q plot be plotted or just report statistics?

nboot

number of replicates to use to calculate p-values for the goodness of fit test statistics

ks

perform the Kolmogorov-Smirnov test (this involves many bootstraps so can take a while)

...

additional arguments passed to plot

Details

The Kolmogorov-Smirnov test asks the question "what's the largest vertical distance between a point and the y=x line?" It uses this distance as a statistic to test the null hypothesis that the samples (EDF and CDF in our case) are from the same distribution (and hence our model fits well). If the deviation between the y=x line and the points is too large we reject the null hypothesis and say the model doesn't have a good fit.

Rather than looking at the single biggest difference between the y=x line and the points in the Q-Q plot, we might prefer to think about all the differences between line and points, since there may be many smaller differences that we want to take into account rather than looking for one large deviation. Its null hypothesis is the same, but the statistic it uses is the sum of the deviations from each of the point to the line.

Value

A list of goodness of fit related values:

edf

matrix of lower and upper empirical distribution function values

cdf

fitted cumulative distribution function values

ks

list with K-S statistic (Dn) and p-value (p)

CvM

list with CvM statistic (W) and p-value (p)

Details

Note that a bootstrap procedure is required 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.

Author(s)

Jeff Laake, David L Miller

References

Burnham, K.P., S.T. Buckland, J.L. Laake, D.L. Borchers, T.A. Marques, J.R.B. Bishop, and L. Thomas. 2004. Further topics in distance sampling. pp: 385-389. In: Advanced Distance Sampling, eds. S.T. Buckland, D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. Oxford University Press.

See Also


mrds

Mark-Recapture Distance Sampling

v2.2.4
GPL (>= 2)
Authors
Jeff Laake <jeff.laake@noaa.gov>, David Borchers <dlb@st-and.ac.uk>, Len Thomas <len.thomas@st-and.ac.uk>, David Miller <dave@ninepointeightone.net> and Jon Bishop
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.