hist.sbm {sbd}R Documentation

Plot size biased distribution

Description

Plots the frequency histogram of data from a size biased model, with fitted parametric distribution line if the model is parametric without covariates.

Usage

## S3 method for class 'sbm'
hist(x, log = TRUE, add = FALSE, breaks = 20, lpar = list(col = "red"), ...)

Arguments

x

A size biased model fit of class sbm.

log

A logical specifying whether to plot the log transformed or untransformed data distribution.

add

A logical specifying whether to create a new plot, or add a parametric distribution curve to an existing plot.

breaks

Integer defining number of breaks when generating histogram (passed to hist).

lpar

A list of plotting parameters controlling appearance of the density curve line (if present - passed to lines).

...

Additional parameters passed to plot, including those affecting histogram appearance.

Value

None.

Examples

  # Fit and plot log-normal and Weibull models
  data(BCI_speed_data)
  agoutiData <- subset(BCI_speed_data, species=="agouti")
  lmod <- sbm(speed~1, agoutiData, pdf="lnorm")
  wmod <- sbm(speed~1, agoutiData, pdf="weibull")
  hist(lmod, breaks = 40)
  hist(wmod, add=TRUE, lpar=list(col="blue"))

[Package sbd version 0.1.0 Index]