ci_kurtosis: Confidence Interval for the Kurtosis

Description Usage Arguments Details Value References See Also Examples

View source: R/ci_kurtosis.R

Description

This function calculates bootstrap confidence intervals for the population kurtosis, see Details. Note that we use the version of the kurtosis that equals 3 for a theoretical normal distribution.

Usage

1
2
3
4
5
6
7
8
9
ci_kurtosis(
  x,
  probs = c(0.025, 0.975),
  type = "bootstrap",
  boot_type = c("bca", "perc", "norm", "basic"),
  R = 9999,
  seed = NULL,
  ...
)

Arguments

x

A numeric vector.

probs

Error probabilites. The default c(0.025, 0.975) gives a symmetric 95% confidence interval.

type

Type of confidence interval. Currently not used as the only type is "bootstrap".

boot_type

Type of bootstrap confidence interval c("bca", "perc", "norm", "basic").

R

The number of bootstrap resamples.

seed

An integer random seed.

...

Further arguments passed to boot::boot.

Details

Bootstrap confidence intervals are calculated by the package "boot", see references. The default bootstrap type is "bca" (bias-corrected accelerated) as it enjoys the property of being second order accurate as well as transformation respecting (see Efron, p. 188).

Value

A list with class cint containing these components:

References

  1. Efron, B. and Tibshirani R. J. (1994). An Introduction to the Bootstrap. Chapman & Hall/CRC.

  2. Canty, A and Ripley B. (2019). boot: Bootstrap R (S-Plus) Functions.

See Also

moments, ci_skewness.

Examples

1
2
3
set.seed(1)
x <- rnorm(100)
ci_kurtosis(x, R = 999)

Example output

	Two-sided 95% bootstrap confidence interval for the population
	kurtosis based on 999 bootstrap replications and the bca method

Sample estimate: 3.007653 
Confidence interval:
    2.5%    97.5% 
2.455576 3.776262 

confintr documentation built on July 2, 2020, 1:51 a.m.