Learn R Programming

zipfR (version 0.6-70)

confint.lnre: Confidence Intervals for LNRE Model Parameters (zipfR)

Description

Compute bootstrapped confidence intervals for LNRE model parameters. The supplied model must contain a sufficient number of bootstrapping replicates.

Usage

# S3 method for lnre
confint(object, parm, level=0.95, method=c("mad", "normal", "empirical"), 
        plot=FALSE, breaks="Sturges", …)

Arguments

object

an LNRE model (i.e. an object belonging to a subclass of lnre) with bootstrapping data

parm

model parameter(s) for which confidence intervals are desired. If unspecified, all parameters as well as population diversity \(S\) and goodness-of-fit statistic \(X^2\) are shown.

level

desired confidence level (two-sided)

method

type of confidence interval to be estimated (see bootstrap.confint for details). Note that this parameter defaults to the asymmetric and more robust mad method here.

plot

if TRUE, plot bootstrapping histogram of the respective model parameter with density estimate and confidence interval

breaks

breakpoints for histogram shown with plot=TRUE (see hist for details)

all other arguments are ignored

Value

A data frame with one numeric column for each selected model parameter (labelled with the parameter name) and four rows:

  1. the lower boundary of the confidence interval (labelled with the corresponding quantile, e.g. 2.5%)

  2. the upper boundary of the confidence interval (labelled with the corresponding quantile, e.g. 97.5%)

  3. an estimate of central tendency (labelled center)

  4. an estimate of spread on a scale comparable to standard deviaton (labelled spread)

See Also

lnre for estimating LNRE models with bootstrap replicates, lnre.bootstrap for the underlying parameteric bootstrapping code, and bootstrap.confint for the different methods of estimating confidence intervals.

Examples

Run this code
# NOT RUN {
model <- lnre("fzm", spc=BrownAdj.spc, bootstrap=20)
confint(model, "alpha") # Zipf slope
confint(model, "S")     # population diversity
confint(model, "S", method="normal") # Gaussian approx works well in this case

confint(model) # overview
confint(model, "alpha", plot=TRUE) # visualize bootstrap distribution
# }

Run the code above in your browser using DataLab