qqsad and qqrad methods {sads}R Documentation

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

## S4 method for signature 'fitsad'
qqsad(x, plot=TRUE, line=TRUE, ...)
## S4 method for signature 'numeric'
qqsad(x, sad, coef, trunc=NA, distr, plot=TRUE,
line=TRUE, ...)
## S4 method for signature 'fitrad'
qqrad(x, plot=TRUE, line=TRUE, ...)
## S4 method for signature 'rad'
qqrad(x, rad, coef, trunc=NA, plot=TRUE, line=TRUE, ...)
## S4 method for signature 'numeric'
qqrad(x, rad, coef, trunc=NA, plot=TRUE, line=TRUE, ...)

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 this argument can be also a rank-abundance table of rad-class.

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

Deprecated since sads 0.2.4. See distr function

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.

Methods

qqsad

signature(x = "fitsad", sad = "missing", coef = "missing", trunc = "missing", distr = "missing", plot="ANY", line="ANY"): quantile-quantile plot for a fitted model of species abundances (a fitsad-class object). Only argument x should be provided

qqsad

signature(x = "numeric", sad = "character", coef = "list", trunc = "ANY", distr = "ANY", plot="ANY", line="ANY"): quantile-quantile plot of a numeric vector of abundances (x) vs a species abundance distributions defined by the following arguments.

qqrad

signature(x = "fitrad", rad = "missing", coef = "missing", trunc = "missing", plot="ANY", line="ANY"): quantile-quantile plot for a fitted model of species abundances ranks (a fitrad-class object). Only argument x should be provided

qqrad

signature(x = "rad", rad = "character", coef = "list", trunc = "ANY", plot="ANY", line="ANY"): quantile-quantile plot of a table of abundance ranks (x) vs a species rank-abundance distribution defined by the following arguments.

qqrad

signature(x = "numeric", rad = "character", coef = "list", trunc = "ANY", plot="ANY", line="ANY"): quantile-quantile plot of a numeric vector of abundances (x) vs a species rank-abundance distribution defined by the following arguments.

Author(s)

Paulo I Prado prado@ib.usp.br and Murilo Dantas Miranda.

References

Thas, O. 2010. Comparing distributions. Springer.

Examples

## 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)))
qqsad(moths.ln)
qqsad(moths, sad="lnorm", coef=as.list(coef(moths.ln)), trunc=0.5)
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))

[Package sads version 0.6.3 Index]