stat_density_confidence: Normal Theory Based Confidence Envelope for Density

View source: R/stat_density_confidence.R

stat_density_confidenceR Documentation

Normal Theory Based Confidence Envelope for Density

Description

This function creates a normal theory based confidence envelope for the empirical density. The idea came from functions written by Bowman and Azzalini.

Usage

stat_density_confidence(
  mapping = NULL,
  data = NULL,
  geom = "ribbon",
  position = "identity",
  na.rm = TRUE,
  inherit.aes = TRUE,
  h = NULL,
  fill = "skyblue",
  fade = FALSE,
  model = "none",
  ...
)

Arguments

h

A normal kernel function is used and h is its standard deviation. If this parameter is omitted, a normal optimal smoothing parameter is used.

fill

Fill color for the confidence envelope. The default is fill="skyblue"

model

The model to draw the confidence envelope for. The default is model="none" which creates the confidence envelope from the data. Using model="normal" creates the confidence envelope based on a normal distribution.

Aesthetics

These stat uses geom_ribbon() so support the same aesthetics: alpha, colour, fill, linetype, group, and size.


zief0002/educate documentation built on July 27, 2023, 9:25 a.m.