Learn R Programming

mrds (version 2.2.4)

ddf.gof: Goodness of fit tests for distance sampling models

Description

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).

Usage

ddf.gof(
  model,
  breaks = NULL,
  nc = NULL,
  qq = TRUE,
  nboot = 100,
  ks = FALSE,
  ...
)

Arguments

model

model object

breaks

Cutpoints to use for binning data

nc

Number of distance classes

qq

Flag to indicate whether quantile-quantile plot is desired

nboot

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

ks

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

Graphics parameters to pass into qqplot function

Value

List of class ddf.gof containing

chi-square

Goodness of fit test statistic

df

Degrees of freedom associated with test statistic

p-value

Significance level of test statistic

Details

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).

See Also

qqplot.ddf