Learn R Programming

zipfR (version 0.6-70)

bootstrap.confint: Estimate Confidence Intervals from Parametric Bootstrap Simulations (zipfR)

Description

Estimate confidence intervals for empirical distributions obtained by parametric bootstrapping. The input data must contain a sufficient number of bootstrap replicates for the desired confidence level.

Usage

bootstrap.confint(x, level=0.95, 
                  method=c("normal", "mad", "empirical"),
                  data.frame=FALSE)

Arguments

x

a numeric matrix, with rows corresponding to bootstrap replicates and columns corresponding to different statistics or coefficients. The matrix should have column labels, which will be preserved in the result. A data frame with numeric columns is automatically converted to a matrix.

level

desired confidence level (two-sided)

method

type of confidence interval to be estimated (see "Details" below)

data.frame

if TRUE, the return value is converted to a data frame

Value

A numeric matrix with the same number of columns and column labels as x, 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)

If data.frame=TRUE, the matrix is converted to a data frame for convenient printing and access in interactive sessions.

Details

This function can compute three different types of confidence intervals, selected by the method parameter. In addition, corresponding estimates of central tendency (center) and spread (spread) of the distribution are returned.

normal:

Wald-type confidence interval based on normal approximation of the bootstrapped distribution (default). Central tendency is given by the sample mean, spread by standard deviation.

This method is unreliable if the bootstrapping produces outlier results and can report confidence limits outside the feasible range of a parameter or coefficient (e.g. a negative population diversity \(S\)). For this reason, it is strongly recommended to use a more robust type of confidence interval.

mad:

Robust asymmetric confidence intervals around the median, using separate estimates for left and right median absolute deviation (MAD) as robust approximations of standard deviation. Central tendency is given by the median, and spread by the average of left and right standard deviation (estimated via MAD).

This method is applicable in most situations and requires fewer bootstrap replicates than empirical confidence intervals. Note that the values are different from those returned by mad because of the separate left and right estimators.

empirical:

The empirical inter-quantile range, e.g. 2.5% to 97.5% for default conf.level=.95. Note that the actual range might be slightly different depending on the number of bootstrap replicates available. Central tendency is given by the median, and spread by the inter-quartile range (IQR) re-scaled to be comparable to standard deviation (cf. IQR).

This is the only method guaranteed to stay within feasible range, but requires a large number of bootstrap replicates for reliable confidence intervals (e.g. at least 120 replicates for the default 95% confidence level).

See Also

bootstrap.confint is usually applied to the output of lnre.bootstrap with simplify=TRUE. In particual, confint.lnre uses this function to obtain bootstrapped confidence intervals for LNRE model parameters and other coefficients; lnre.productivity.measures (with bootstrap=TRUE) uses it to determine approximate sampling distributions of productivity measures for a LNRE population.

Examples

Run this code
# NOT RUN {
M <- cbind(alpha=rnorm(200, 10, 5),      # Gaussian distribution around mean = 10
           beta=rlnorm(200, log(10), 1)) # log-normal distribution around median = 10

summary(M) # overview of the distribution

bootstrap.confint(M, method="normal")    # normal approximation
bootstrap.confint(M, method="mad")       # robust asymmetric MAD estimates
bootstrap.confint(M, method="empirical") # empirical confidence interval

bootstrap.confint(M, method="normal", data.frame=TRUE) # as data frame
# }

Run the code above in your browser using DataLab