Learn R Programming

sads (version 0.2.2)

qqsad and qqrad methods: Quantile-quantile plots for species-abundance and rank-abundance models

Description

Plots empirical quantiles vs corresponding theoretical values expected by a model for species abundances (SAD) or a model for species abundance ranks (RAD).

Usage

## S3 method for class 'fitsad':
qqsad(x, plot=TRUE, line=TRUE, \dots)
## S3 method for class 'numeric':
qqsad(x, sad, coef, trunc=NA, distr, plot=TRUE,
line=TRUE, \dots)
## S3 method for class 'fitrad':
qqrad(x, plot=TRUE, line=TRUE, \dots)
## S3 method for class 'rad':
qqrad(x, rad, coef, trunc=NA, plot=TRUE, line=TRUE, \dots)
## S3 method for class 'numeric':
qqrad(x, rad, coef, trunc=NA, plot=TRUE, line=TRUE, \dots)

Arguments

x
a numeric vector of abundances of species or a fitted sad/rad model (object of fitsad-class or fitrad-class, respectively). For qqrad
sad, rad
character; root name of sad or rad distribution to calculate expected percentiles. See fitsad and fitrad for available distributions.
coef
named list of numeric values; parameter values of the distribution given in sad or rad. Parameters should be named as in the corresponding density function, and in the same order
trunc
non-negative integer, trunc > min(x); truncation point to fit a truncated distribution.
distr
character; type of distribution given in sad: "D" for discrete or "C" for continuous.
plot
logical; if TRUE a percentile-percentile plot is produced. If not, only a data frame with theoretical and empirical values for percentiles of the data is invisibly returned.
line
logical; if TRUE and plot is TRUE, the equivalence line y=x with abline(0,1) is added to the plot. If not, no line is drawn.
...
further arguments to be passed to the plot function.

References

Thas, O. 2010. Comparing distributions. Springer.

Examples

Run this code
## An example with SADs
data(moths)
## fits log-series distribution to abundance data
moths.ls <- fitsad(moths, "ls")
## fits lognormal distribution truncated at 0.5
moths.ln <- fitsad(moths,"lnorm", trunc=0.5)
## Plots with the model object and with abundance vector 
par(mfrow=c(2,2))
qqsad(moths.ls)
qqsad(moths, sad="ls", coef=as.list(coef(moths.ls)), distr="D")
qqsad(moths.ln)
qqsad(moths, sad="lnorm", coef=as.list(coef(moths.ln)), trunc=0.5, distr="C")
par(mfrow=c(1,1))

## An example with RADs
data(okland)
## Fits broken-stick RAD model
ok.bs <- fitrad(okland, "rbs")
## Fits geometric series RAD model
ok.gs <- fitrad(okland, "gs")
## Plots with the model object and with the abundance vector 
par( mfrow=c(2, 2) )
qqrad(ok.bs)
qqrad(okland, rad="rbs", coef=as.list(coef(ok.bs)))
qqrad(ok.gs)
qqrad(okland, rad="gs", coef=as.list(coef(ok.gs)))
par(mfrow=c(1,1))

Run the code above in your browser using DataLab