quantile_ci: Calculating the confidence intervals (CIs) of a quantile...

Description Usage Arguments Value Examples

View source: R/quantile_ci.R

Description

quantile_ciEstimates CIs around a quantile percentile estimate using non-parametric bootstrapping from the boot package

Usage

1
2
3
4
5
6
7
quantile_ci(
  observations,
  percentile,
  bootstraps = 1e+05,
  conf = 0.95,
  type = "perc"
)

Arguments

observations

A vector of observations given as numeric values

percentile

The percentile of interest

bootstraps

The number of bootstraps you want to run to create the CIs, defaults to 100000

conf

The confidence level wanted. Defaults to 95% CI.

type

A vector of character strings representing the type of intervals required to calculate the CI. Defaults to "bca". See ??boot.ci for more information.

Value

The quantile estimate and confidence intervals.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Gather sightings of iNaturalist observations for four species:
# Danaus plexippus, Speyeria cybele, Rudbeckia hirta, and Asclepias syriaca

# Estimate when the first 10 percent of individuals of the butterfly species
# Speyeria cybele are in flight.

data(inat_examples)
s_cybele <- subset(inat_examples, scientific_name == "Speyeria cybele")
quantile_ci(observations = s_cybele$doy, percentile = 0.1, bootstraps = 100)

# note low number of bootstraps for quick processing speed

phenesse documentation built on July 29, 2020, 1:06 a.m.